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