py23 fixes for psLib and t1Lib
Still not working with Python 3 as psLib's PSTokenizer subclasses
StringIO and expects it to have buf and pos. Need to rewrite
this to implement StringIO internally.
diff --git a/Lib/fontTools/t1Lib.py b/Lib/fontTools/t1Lib.py
index aae86d9..abd4f32 100644
--- a/Lib/fontTools/t1Lib.py
+++ b/Lib/fontTools/t1Lib.py
@@ -338,17 +338,17 @@
# Type 1 assertion
-_fontType1RE = re.compile(r"/FontType\s+1\s+def")
+_fontType1RE = re.compile(br"/FontType\s+1\s+def")
def assertType1(data):
- for head in ['%!PS-AdobeFont', '%!FontType1']:
+ for head in [b'%!PS-AdobeFont', b'%!FontType1']:
if data[:len(head)] == head:
break
else:
raise T1Error("not a PostScript font")
if not _fontType1RE.search(data):
raise T1Error("not a Type 1 font")
- if data.find("currentfile eexec") < 0:
+ if data.find(b"currentfile eexec") < 0:
raise T1Error("not an encrypted Type 1 font")
# XXX what else?
return data