Skip to content

Commit

Permalink
Fix import recording warning
Browse files Browse the repository at this point in the history
Modified find_module to be compatible with find_spec. Fixes this warning:

tests/test_Config.py::ConfigTest::testBadImports
tests/test_Config.py::ConfigTest::testImports
  <frozen importlib._bootstrap>:914: ImportWarning: RecordingImporter.find_spec() not found; falling back to find_module()
  • Loading branch information
timj committed Jul 1, 2023
1 parent f4a7d04 commit f80511f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/pex/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def uninstall(self):
"""Uninstall the importer."""
sys.meta_path = self.origMetaPath

def find_module(self, fullname, path=None):
def find_spec(self, fullname, path, target=None):
"""Find a module.
Called as part of the ``import`` chain of events.
Expand Down

0 comments on commit f80511f

Please sign in to comment.