aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-07 13:14:12 +0100
committerChristian Tismer <tismer@stackless.com>2020-01-24 12:29:13 +0000
commite588c72245f91c078f483011420567a93191f6c0 (patch)
treecf7edd645c8be90b0b5e2539e2e2d7285b8b819a
parent422546c884b9115cc2f1ba35bca36cc09a0a71ec (diff)
PySide2/__init__.py: Print import errors verbosely
Change-Id: I9cac73af695ecb123bc0e0b6ce35a10ee1026ea2 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/pyside2/PySide2/__init__.py.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/__init__.py.in b/sources/pyside2/PySide2/__init__.py.in
index d896ab603..b6d0b89b3 100644
--- a/sources/pyside2/PySide2/__init__.py.in
+++ b/sources/pyside2/PySide2/__init__.py.in
@@ -1,3 +1,6 @@
+from __future__ import print_function
+
+
__all__ = list("Qt" + body for body in
"@all_module_shortnames@"
.split(";"))
@@ -18,7 +21,14 @@ def _setupQtDirectories():
# 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
+ try:
+ import shiboken2
+ except Exception:
+ paths = ', '.join(sys.path)
+ print('PySide2/__init__.py: Unable to import shiboken2 from {}'.format(paths),
+ file=sys.stderr)
+ raise
+
# Trigger signature initialization.
type.__signature__