Skip to content

Commit

Permalink
Fix for #281
Browse files Browse the repository at this point in the history
It seem that in 3.11 there is now another FrozenImporter from
_frozen_importlib, I did not manage to get isinstance to work with it so
we need to check with hasattr.
  • Loading branch information
Carreau committed Jan 23, 2024
1 parent 5d06d73 commit 6a55404
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/python/pyflyby/_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ def filename(self):
# Get the filename using loader.get_filename(). Note that this does
# more than just loader.filename: for example, it adds /__init__.py
# for packages.
if not hasattr(loader, 'get_filename'):
return None
filename = loader.get_filename()
if not filename:
return None
Expand Down

0 comments on commit 6a55404

Please sign in to comment.