diff options
author | Christian Tismer <tismer@stackless.com> | 2022-03-09 19:00:02 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2022-03-11 10:18:16 +0100 |
commit | 332b99ecda74e5d575d4ddcd2d86fa4ffc283e3c (patch) | |
tree | 07ece950c1b89f586f80ee804d68cc5ab638a2a5 /sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py | |
parent | 6ffb2c3e852e2153b0c58ac659e7d8b60b691f19 (diff) |
PyPySide: disable __feature__ completely, temporarily
PyPy is currently not able to handle feature switching.
This was disabled, internally only.
Be more consequent and avoid a misleading feature that
does not work.
This will be re-enabled as soon as PyPy is able to
exchange class dictionaries.
[ChangeLog][PySide6] Feature switching is not only disabled,
but also syntactically not allowed in PyPy.
Task-number: PYSIDE-535
Change-Id: Ic6a9ef3233db787e050a1ee5c913c24ae6650168
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py')
-rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py index a4a82d893..38beb06bc 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py @@ -102,6 +102,8 @@ __feature__.pyside_feature_dict = signature_bootstrap.pyside_feature_dict builtins.__feature_import__ = signature_bootstrap.__feature_import__ del signature_bootstrap +is_pypy = hasattr(sys, "pypy_version_info") + def put_into_package(package, module, override=None): # take the last component of the module name @@ -124,7 +126,8 @@ def move_into_pyside_package(): except ModuleNotFoundError: # This can happen in the embedding case. put_into_package(PySide6, shibokensupport, "support") - put_into_package(PySide6.support, __feature__, "__feature__") + if not is_pypy: + put_into_package(PySide6.support, __feature__, "__feature__") put_into_package(PySide6.support, signature) put_into_package(PySide6.support.signature, mapping) put_into_package(PySide6.support.signature, errorhandler) @@ -158,7 +161,7 @@ if "PySide6" in sys.modules: raise # PYSIDE-1019: Modify `__import__` to be `__feature__` aware. # __feature__ is already in sys.modules, so this is actually no import - if not hasattr(sys, "pypy_version_info"): + if not is_pypy: # PYSIDE-535: Cannot enable __feature__ for various reasons. import PySide6.support.__feature__ sys.modules["__feature__"] = PySide6.support.__feature__ |