aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-04-18 18:58:18 +0200
committerChristian Tismer <tismer@stackless.com>2021-06-29 14:11:37 +0000
commit7a3d57d8400ff25ffc609f327fca2bf33e312b77 (patch)
treec30e276e4750a1fd629ae0c276ca223c54c943a3 /testing
parent98aef951920641dcdf4c217a0c51626cdf82caf8 (diff)
PyPySide: Do some preliminary cleanups before the transition
The transition to the future PyPy support needs some cleanups, first. The goal is to get rid of all macros which handle type objects. This works in PySide on Python, but not with PyPy, which is emulating the whole interface. The shibokengenerator expression if (type->isWrapperType() || type->isEnum() || type->isFlags()) return QString::fromLatin1("*PepType_SGTP(%1)->converter").arg(cpythonTypeNameExt(type)); builds a very unfortunate union of the three possible macro type extensions that makes it impossible to do incremental changes. `PepType_SGTP` is therefore now completely gone. Finding this problem was a major showstopper. Furthermore, the usage of the __builtins__ dict object is not PyPy compatible and replaced by the builtins module. Task-number: PYSIDE-535 Change-Id: Ic32431b665aae43bb8c9735f69a54f7b3fae8b48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'testing')
-rw-r--r--testing/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/__init__.py b/testing/__init__.py
index c97f32187..001446994 100644
--- a/testing/__init__.py
+++ b/testing/__init__.py
@@ -44,19 +44,20 @@ testing/__init__.py
- define command.main as entry point
"""
+import builtins
import sys
from . import command
main = command.main
# modify print so that it always flushes
-__builtins__["orig_print"] = __builtins__["print"]
+builtins.orig_print = builtins.print
def print_flushed(*args, **kw):
orig_print(*args, **kw)
sys.stdout.flush()
-__builtins__["print"] = print_flushed
+builtins.print = print_flushed
print = print_flushed