mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
issue #2959: another Py2 bugfix
This commit is contained in:
parent
524addc499
commit
971837cc00
|
@ -294,7 +294,7 @@ def pdf_repr(x):
|
|||
return bytes(PdfDict(x))
|
||||
elif isinstance(x, list):
|
||||
return bytes(PdfArray(x))
|
||||
elif isinstance(x, str) and str != bytes:
|
||||
elif (str == bytes and isinstance(x, unicode)) or (str != bytes and isinstance(x, str)):
|
||||
return pdf_repr(encode_text(x))
|
||||
elif isinstance(x, bytes):
|
||||
return b"(" + x.replace(b"\\", b"\\\\").replace(b"(", b"\\(").replace(b")", b"\\)") + b")" # XXX escape more chars? handle binary garbage
|
||||
|
|
Loading…
Reference in New Issue
Block a user