diff options
Diffstat (limited to 'sources/pyside2/PySide2/__init__.py.in')
-rw-r--r-- | sources/pyside2/PySide2/__init__.py.in | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in index ab50ef776..ac75f52b6 100644 --- a/sources/pyside2/PySide2/__init__.py.in +++ b/sources/pyside2/PySide2/__init__.py.in @@ -4,21 +4,23 @@ __all__ = list("Qt" + body for body in __version__ = "@FINAL_PACKAGE_VERSION@" __version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@, "@BINDING_API_PRE_RELEASE_VERSION_TYPE@", "@BINDING_API_PRE_RELEASE_VERSION@") -@PYSIDE_BUILD_DATE@ -@PYSIDE_BUILD_COMMIT_DATE@ -@PYSIDE_BUILD_COMMIT_HASH@ -@PYSIDE_BUILD_COMMIT_HASH_DESCRIBED@ - -# Timestamp used for snapshot build, which is part of snapshot package version. -@PYSIDE_SETUP_PY_PACKAGE_TIMESTAMP_ASSIGNMENT@ - def _setupQtDirectories(): import sys import os + # On Windows we need to explicitly import the shiboken2 module so + # that the libshiboken.dll dependency is loaded by the time a + # Qt module is imported. Otherwise due to PATH not containing + # the shiboken2 module path, the Qt module import would fail + # due to the missing libshiboken dll. + # We need to do the same on Linux and macOS, because we do not + # embed rpaths into the PySide2 libraries that would point to + # the libshiboken library location. Importing the module + # loads the libraries into the process memory beforehand, and + # thus takes care of it for us. + import shiboken2 + pyside_package_dir = os.path.abspath(os.path.dirname(__file__)) - # Used by signature module. - os.environ["PYSIDE_PACKAGE_DIR"] = pyside_package_dir if sys.platform == 'win32': # PATH has to contain the package directory, otherwise plugins |