From 59afba7684d4c2f7760be5dbc1aeffceb8ced46f Mon Sep 17 00:00:00 2001 From: jvr Date: Sat, 24 May 2003 12:34:11 +0000 Subject: [PATCH] updated for MacPython2.3 git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@392 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/t1Lib.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Lib/fontTools/t1Lib.py b/Lib/fontTools/t1Lib.py index 22556aabb..2dcd05381 100644 --- a/Lib/fontTools/t1Lib.py +++ b/Lib/fontTools/t1Lib.py @@ -35,7 +35,11 @@ except ImportError: haveMacSupport = 0 else: haveMacSupport = 1 - import macfs + try: + from Carbon.File import FSSpec + except ImportError: + from macfs import FSSpec # MacPython < 2.2 + class T1Error(Exception): pass @@ -91,7 +95,7 @@ def read(path): """reads any Type 1 font file, returns raw data""" normpath = string.lower(path) if haveMacSupport: - fss = macfs.FSSpec(path) + fss = FSSpec(path) creator, type = fss.GetCreatorType() if type == 'LWFN': return readLWFN(path), 'LWFN' @@ -242,7 +246,7 @@ def writePFB(path, data): finally: f.close() if haveMacSupport: - fss = macfs.FSSpec(path) + fss = FSSpec(path) fss.SetCreatorType('mdos', 'BINA') def writeOther(path, data, dohex = 0): @@ -265,7 +269,7 @@ def writeOther(path, data, dohex = 0): finally: f.close() if haveMacSupport: - fss = macfs.FSSpec(path) + fss = FSSpec(path) fss.SetCreatorType('R*ch', 'TEXT') # BBEdit text file