From 552fa129005ab631717b5141e46dd86157c8a9bc Mon Sep 17 00:00:00 2001 From: Vincent A Date: Tue, 6 Apr 2021 22:59:38 +0200 Subject: [PATCH] weboob compat: prepend our compatibility Finder instead of append If we append, "weboob.x" will not be resolved by regular Finders so our custom finder will be hit. However, for importing "weboob.x.y", standard Finders will find something, basing on "weboob.x.__spec__", and eventually duplicating python modules, precisely what we wanted to avoid. To ensure our custom Finder is called even for "weboob.x.y", prepend it. --- weboob/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weboob/__init__.py b/weboob/__init__.py index 49f2ba9430..843256219e 100644 --- a/weboob/__init__.py +++ b/weboob/__init__.py @@ -56,4 +56,4 @@ def find_module(self, fullname, path=None): return AliasLoader() -sys.meta_path.append(AliasImporter()) +sys.meta_path.insert(0, AliasImporter()) -- GitLab