leptonica: fix junkpixt harder

This commit is contained in:
James R. Barlow
2019-03-16 14:08:58 -07:00
parent 210f134b5b
commit 4e2a98ead4
+4 -3
View File
@@ -614,9 +614,10 @@ class Pix(LeptonicaObject):
except (LeptonicaError, ValueError, IndexError):
return
finally:
with suppress(FileNotFoundError):
os.unlink('junkpixt.png') # leptonica may produce this
os.unlink('junkpixt')
leptonica_junk = ('junkpixt.png', 'junkpixt')
for junk in leptonica_junk:
with suppress(FileNotFoundError):
os.unlink(junk) # leptonica may produce this
for n, s in enumerate(sarray):
decoded = s.decode()