diff --git a/src/silfont/ipython.py b/src/silfont/ipython.py index 77b702c..222d53d 100644 --- a/src/silfont/ipython.py +++ b/src/silfont/ipython.py @@ -83,7 +83,7 @@ def loadFont(fname): return f def displayGlyphs(f, gnames, points=None, scale=None): - if not hasattr(gnames, '__len__') or isinstance(gnames, basestring): + if not hasattr(gnames, '__len__') or isinstance(gnames, (str,bytes)): gnames = [gnames] if not hasattr(points, '__len__'): points = [] diff --git a/src/silfont/scripts/psfcopymeta.py b/src/silfont/scripts/psfcopymeta.py index 4841d3a..44f470c 100644 --- a/src/silfont/scripts/psfcopymeta.py +++ b/src/silfont/scripts/psfcopymeta.py @@ -65,7 +65,7 @@ def doit(args) : fupdated = True elif ftag in ("true, false") : if ftag != ttag : - fti.setelem(field, ET.fromstring("<" + ftag + "/>")) + tfi.setelem(field, ET.fromstring("<" + ftag + "/>")) logger.log(message + " Old: '" + ttag + "' New: '" + str(ftag) + "'", "W") fupdated = True elif ftag == "array" : # Assume simple array with just values to compare @@ -77,7 +77,7 @@ def doit(args) : tfi.setelem(field, ET.fromstring(ET.tostring(felem))) logger.log(message + "Some values different Old: " + str(tarray) + " New: " + str(farray), "W") fupdated = True - else : logger.log("Non-standard fontinfo field type: "+ ftag + " in " + fontname, "S") + else : logger.log("Non-standard fontinfo field type: "+ ftag + " in " + fromfont.ufodir, "S") else : tfi.addelem(field, ET.fromstring(ET.tostring(felem))) logger.log(message + "is missing from destination font so will be copied from source font", "W") diff --git a/src/silfont/scripts/psfftml2odt.py b/src/silfont/scripts/psfftml2odt.py index c9408e3..7d67ac6 100644 --- a/src/silfont/scripts/psfftml2odt.py +++ b/src/silfont/scripts/psfftml2odt.py @@ -144,7 +144,7 @@ def getfonts(fontsourcestrings, logfile, fromcommandline=True): checkembeddedfont.append(os.path.basename(fontstring)) except IOError: logfile.log("Unable to find font file to embed: " + fontstring, "E") - except fontTools.ttLib.TTLibError: + except ttLib.TTLibError: logfile.log("File is not a valid font: " + fontstring, "E") except: logfile.log("Error occurred while checking font: " + fontstring, "E") # some other error