Changed: new except syntax (2.6 or above).

pull/1/head
Yusuke Shinyama 2014-06-16 18:50:07 +09:00
parent 28e96ba3d0
commit bb866ae148
3 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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 = ''

View File

@ -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>')