Changed: new except syntax (2.6 or above).
parent
28e96ba3d0
commit
bb866ae148
|
@ -637,7 +637,7 @@ class PDFCIDFont(PDFFont):
|
|||
name = 'unknown'
|
||||
try:
|
||||
self.cmap = CMapDB.get_cmap(name)
|
||||
except CMapDB.CMapNotFound, e:
|
||||
except CMapDB.CMapNotFound as e:
|
||||
if STRICT:
|
||||
raise PDFFontError(e)
|
||||
self.cmap = CMap()
|
||||
|
@ -666,7 +666,7 @@ class PDFCIDFont(PDFFont):
|
|||
else:
|
||||
try:
|
||||
self.unicode_map = CMapDB.get_unicode_map(self.cidcoding, self.cmap.is_vertical())
|
||||
except CMapDB.CMapNotFound, e:
|
||||
except CMapDB.CMapNotFound as e:
|
||||
pass
|
||||
|
||||
self.vertical = self.cmap.is_vertical()
|
||||
|
|
|
@ -236,7 +236,7 @@ class PDFStream(PDFObject):
|
|||
# will get errors if the document is encrypted.
|
||||
try:
|
||||
data = zlib.decompress(data)
|
||||
except zlib.error, e:
|
||||
except zlib.error as e:
|
||||
if STRICT:
|
||||
raise PDFException('Invalid zlib bytes: %r, %r' % (e, data))
|
||||
data = ''
|
||||
|
|
|
@ -104,7 +104,7 @@ def dumpallobjs(out, doc, codec=None):
|
|||
out.write('<object id="%d">\n' % objid)
|
||||
dumpxml(out, obj, codec=codec)
|
||||
out.write('\n</object>\n\n')
|
||||
except PDFObjectNotFound, e:
|
||||
except PDFObjectNotFound as e:
|
||||
print >>sys.stderr, 'not found: %r' % e
|
||||
dumptrailers(out, doc)
|
||||
out.write('</pdf>')
|
||||
|
|
Loading…
Reference in New Issue