Skip to content

Commit

Permalink
Fix some flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bobh0303 committed Jul 25, 2024
1 parent 5aaf44a commit 13cc5a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/silfont/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
4 changes: 2 additions & 2 deletions src/silfont/scripts/psfcopymeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/silfont/scripts/psfftml2odt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13cc5a6

Please sign in to comment.