Fix PdfFileMerger for file objects on Python 3.
The previous check was always evaluated to False on Python 3, so I replaced it with a duck-typing one compatible with both Python versions.
This commit is contained in:
parent
4fc7f9d14a
commit
8ba44f2099
|
@ -113,7 +113,7 @@ class PdfFileMerger(object):
|
|||
if isString(fileobj):
|
||||
fileobj = file(fileobj, 'rb')
|
||||
my_file = True
|
||||
elif isinstance(fileobj, file):
|
||||
elif hasattr(fileobj, "seek") and hasattr(fileobj, "read"):
|
||||
fileobj.seek(0)
|
||||
filecontent = fileobj.read()
|
||||
fileobj = StreamIO(filecontent)
|
||||
|
|
Loading…
Reference in New Issue