Skip to content

Commit

Permalink
The "data.pdf" can be of type PdfFileWriter, which does not have a "s…
Browse files Browse the repository at this point in the history
…tream" attribute. (#15)
  • Loading branch information
ChrisBuergi committed Feb 3, 2022
1 parent 5ed4677 commit 231af75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF3/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def _sweepIndirectReferences(self, externMap, data):
self._sweepIndirectReferences(externMap, realdata)
return data
else:
if data.pdf.stream.closed:
if hasattr(data.pdf, 'stream') and data.pdf.stream.closed:
raise ValueError("I/O operation on closed file: {}".format(data.pdf.stream.name))
newobj = externMap.get(data.pdf, {}).get(data.generation, {}).get(data.idnum, None)
if newobj == None:
Expand Down

0 comments on commit 231af75

Please sign in to comment.