Skip to content

Commit

Permalink
Fix coverage on Python 3.11
Browse files Browse the repository at this point in the history
Something changed about frames, I don't have time to go into details.
  • Loading branch information
mgedmin committed Oct 27, 2022
1 parent 183fe4c commit b968878
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dozer/leak.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def _gen(self, obj, depth=0):
# Exclude all frames that are from this module or reftree.
if (isinstance(ref, FrameType)
and ref.f_code.co_filename in (thisfile, self.filename)):
continue
continue # pragma: nocover -- on Python 3.11 this is never hit?

# Exclude all functions and classes from this module or reftree.
mod = str(getattr(ref, "__module__", ""))
Expand Down
2 changes: 1 addition & 1 deletion dozer/reftree.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _gen(self, obj, depth=0):
self.ignore(refs, refiter)
for ref in refiter:
# Exclude all frames that are from this module.
if isinstance(ref, FrameType):
if isinstance(ref, FrameType): # pragma: nocover on Python 3.11
if ref.f_code.co_filename == self.filename:
continue

Expand Down

0 comments on commit b968878

Please sign in to comment.