File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10670,8 +10670,10 @@ def annots(self, types=None):
1067010670 annot_xrefs = [a[0] for a in self.annot_xrefs() if a[1] in types and a[1] not in skip_types]
1067110671 for xref in annot_xrefs:
1067210672 annot = self.load_annot(xref)
10673- annot._yielded=True
10674- yield annot
10673+ # In #4928, annot can be None, which we need to ignore.
10674+ if annot:
10675+ annot._yielded=True
10676+ yield annot
1067510677
1067610678 def apply_redactions(
1067710679 page: 'Page',
Original file line number Diff line number Diff line change @@ -2213,13 +2213,12 @@ def test_4907():
22132213 display_list = page .get_displaylist (annots = False )
22142214 text_page = display_list .get_textpage ()
22152215
2216+
22162217def test_4928 ():
22172218 path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_4928.pdf' )
22182219 with pymupdf .open (path ) as document :
2219- try :
2220- document .scrub ()
2221- except Exception as e :
2222- print (f'Ignoring expected exception: { e } ' )
2220+ document .scrub ()
2221+
22232222
22242223def test_4902 ():
22252224 print ()
You can’t perform that action at this time.
0 commit comments