mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-22 15:13:50 -06:00
Use find_spec() in meta importer
The `find_module()` method of meta importers has been deprecated for a long time. Python 3.12 no longer falls back to `find_module()`. See: https://docs.python.org/3.12/whatsnew/3.12.html#removed Related: https://pagure.io/freeipa/issue/9437 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
This commit is contained in:
parent
32721c4132
commit
7ddf7711f3
@ -21,10 +21,11 @@ class IpaMetaImporter:
|
||||
def __init__(self, platform):
|
||||
self.platform = platform
|
||||
|
||||
def find_module(self, fullname, path=None):
|
||||
def find_spec(self, fullname, path=None, target=None):
|
||||
"""Meta importer hook"""
|
||||
if fullname in self.modules:
|
||||
return self
|
||||
module = self.load_module(fullname)
|
||||
return module.__spec__
|
||||
return None
|
||||
|
||||
def load_module(self, fullname):
|
||||
|
Loading…
Reference in New Issue
Block a user