From e588c72245f91c078f483011420567a93191f6c0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 7 Jan 2020 13:14:12 +0100 Subject: PySide2/__init__.py: Print import errors verbosely Change-Id: I9cac73af695ecb123bc0e0b6ce35a10ee1026ea2 Reviewed-by: Christian Tismer --- sources/pyside2/PySide2/__init__.py.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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__ -- cgit v1.2.3