diff options
Diffstat (limited to 'sources/shiboken6/shibokenmodule/files.dir/shibokensupport')
-rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py | 13 | ||||
-rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py index 0fa58d22f..50ba751c9 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py @@ -103,6 +103,7 @@ Note: This are two imports. def _import(name, *args, **kwargs): # PYSIDE-1368: The `__name__` attribute does not need to exist in all modules. # PYSIDE-1398: sys._getframe(1) may not exist when embedding. + # PYSIDE-1548: Ensure that features are not affected by other imports. calling_frame = _cf = sys._getframe().f_back importing_module = _cf.f_globals.get("__name__", "__main__") if _cf else "__main__" existing = pyside_feature_dict.get(importing_module, 0) @@ -130,13 +131,11 @@ def _import(name, *args, **kwargs): sys.modules["PySide6.QtCore"].__init_feature__() return sys.modules["__feature__"] - if name.split(".")[0] == "PySide6": - # This is a module that imports PySide6. - flag = existing if isinstance(existing, int) else 0 - else: - # This is some other module. Ignore it in switching. - flag = -1 - pyside_feature_dict[importing_module] = flag + if importing_module not in pyside_feature_dict: + # Ignore new modules if not from PySide. + default = 0 if name.split(".")[0] == "PySide6" else -1 + pyside_feature_dict[importing_module] = default + # Redirect to the original import return original_import(name, *args, **kwargs) _is_initialized = False diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py index 400c36de5..e09e525fd 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py @@ -49,7 +49,7 @@ by producing a lot of clarity. import sys import types -from shibokensupport.signature import inspect +import inspect from shibokensupport.signature import get_signature as get_sig |