aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/__init__.py.in
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-02-26 09:44:01 +0100
committerChristian Tismer <tismer@stackless.com>2019-03-20 17:33:21 +0000
commite8786b9cdccb63aa590af50fe5fa5496c6b216c7 (patch)
tree89f30d78603c81937f0c6dd9f768576b6463f9f7 /sources/pyside2/PySide2/__init__.py.in
parentc32dacab85b435751db2811e7a88d5c03b1856e1 (diff)
Simplify Python Imports For Embedding
After the project split, shiboken exposed its own modules, and the overall structure with shiboken2.support.signature and PySide2.support.signature was already quite complicated. When introducing embedding, it is necessary to have some support folder that gets unpacked from a zipfile. That means, the shiboken2 root directory would be in the zip file in the embedding case. This does not only increase the complexity, it further means that we must make shiboken2.so available in the shiboken2 containing zipfile! In order to avoid that, we stop the dependency from the two support directories and use shibokensupport, instead. The simplification of the loader and other modules is also significant. Task-number: PYSIDE-510 Change-Id: Ic735a8d36f10f03698378f2ac9685a5955e40b0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/__init__.py.in')
-rw-r--r--sources/pyside2/PySide2/__init__.py.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in
index ac75f52b6..4548f89b7 100644
--- a/sources/pyside2/PySide2/__init__.py.in
+++ b/sources/pyside2/PySide2/__init__.py.in
@@ -19,6 +19,11 @@ def _setupQtDirectories():
# loads the libraries into the process memory beforehand, and
# thus takes care of it for us.
import shiboken2
+ # We might be running from CTest and missing shiboken2.__init__,
+ # so here it is again: Help Python2 by pre-loading modules.
+ import sys, zipfile, base64, marshal, io
+ # Trigger signature initialization.
+ type.__signature__
pyside_package_dir = os.path.abspath(os.path.dirname(__file__))