Merge pull request #125 from yosida95/bytes-type
Fix type of an argument to PDFFont#decode to bytes in py3pull/123/head
commit
eddf861fbd
|
@ -1,3 +1,6 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from .pdffont import PDFUnicodeNotDefined
|
from .pdffont import PDFUnicodeNotDefined
|
||||||
|
|
||||||
|
@ -142,8 +145,9 @@ class TagExtractor(PDFDevice):
|
||||||
font = textstate.font
|
font = textstate.font
|
||||||
text = ''
|
text = ''
|
||||||
for obj in seq:
|
for obj in seq:
|
||||||
obj = utils.make_compat_str(obj)
|
if isinstance(obj, six.text_type):
|
||||||
if not isinstance(obj, str):
|
obj = utils.make_compat_bytes(obj)
|
||||||
|
if not isinstance(obj, six.binary_type):
|
||||||
continue
|
continue
|
||||||
chars = font.decode(obj)
|
chars = font.decode(obj)
|
||||||
for cid in chars:
|
for cid in chars:
|
||||||
|
|
Loading…
Reference in New Issue