diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py
index d0deee0a2baa467611c7658a19cd847715043ad0..5da7f9d613e0301e4b84b7d74555c40783eedc4e 100644
--- a/io_mesh_ply/import_ply.py
+++ b/io_mesh_ply/import_ply.py
@@ -64,7 +64,7 @@ class property_spec(object):
                 ans = []
                 for i in range(count):
                     s = stream[i]
-                    if len(s) < 2 or s[0] != '"' or s[-1] != '"':
+                    if not (len(s) >= 2 and s.startswith(b'"') and s.endswith(b'"')):
                         print('Invalid string', s)
                         print('Note: ply_import.py does not handle whitespace in strings')
                         return None