Remove leftover Python 2 compatibility shim

In Python 3, __str__ should not return bytes.
This commit is contained in:
Jon Dufresne 2020-01-26 14:46:27 -08:00
parent 22a6738a81
commit d57d02e827

View File

@ -241,15 +241,11 @@ class PdfName:
result.extend(make_bytes("#%02X" % b)) result.extend(make_bytes("#%02X" % b))
return bytes(result) return bytes(result)
__str__ = __bytes__
class PdfArray(list): class PdfArray(list):
def __bytes__(self): def __bytes__(self):
return b"[ " + b" ".join(pdf_repr(x) for x in self) + b" ]" return b"[ " + b" ".join(pdf_repr(x) for x in self) + b" ]"
__str__ = __bytes__
class PdfDict(collections.UserDict): class PdfDict(collections.UserDict):
def __setattr__(self, key, value): def __setattr__(self, key, value):