Merge pull request #294 from qedsoftware/fix-merger-fileobj
Fix PdfFileMerger for file objects on Python 3. Fixes #293
This commit is contained in:
commit
2f6d2da565
|
@ -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