Skip to content

Implement DynamicImporter.find_spec()

Miro Hrončok requested to merge hroncok/pygobject:find_spec into master

On Python 3.10, the code raised an ImportWarning:

ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module()

See https://docs.python.org/3.10/whatsnew/3.10.html#deprecated

Starting in this release, there will be a concerted effort to begin cleaning up old import semantics that were kept for Python 2.7 compatibility. Specifically, find_loader()/find_module() (superseded by find_spec()), load_module() (superseded by exec_module()), module_repr() (which the import system takes care of for you), the package attribute (superseded by spec.parent), the loader attribute (superseded by spec.loader), and the cached attribute (superseded by spec.cached) will slowly be removed (as well as other classes and methods in importlib). ImportWarning and/or DeprecationWarning will be raised as appropriate to help identify code which needs updating during this transition.

Fixes #473 (closed)

Edited by Miro Hrončok

Merge request reports

Loading