aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2')
-rw-r--r--sources/shiboken2/libshiboken/signature.cpp7
-rw-r--r--sources/shiboken2/shibokenmodule/support/signature/loader.py34
2 files changed, 24 insertions, 17 deletions
diff --git a/sources/shiboken2/libshiboken/signature.cpp b/sources/shiboken2/libshiboken/signature.cpp
index da9c56c62..d6c26ac79 100644
--- a/sources/shiboken2/libshiboken/signature.cpp
+++ b/sources/shiboken2/libshiboken/signature.cpp
@@ -445,8 +445,11 @@ static const char PySide_PythonCode[] =
with open(__file__) as _f:
exec(compile(_f.read(), __file__, 'exec'))
except Exception as e:
- print('Exception:', e)
- traceback.print_exc(file=sys.stdout)
+ try:
+ from shiboken2.support.signature import loader
+ except:
+ print('Exception:', e)
+ traceback.print_exc(file=sys.stdout)
globals().update(locals())
)~";
diff --git a/sources/shiboken2/shibokenmodule/support/signature/loader.py b/sources/shiboken2/shibokenmodule/support/signature/loader.py
index 40ad95bdd..458759845 100644
--- a/sources/shiboken2/shibokenmodule/support/signature/loader.py
+++ b/sources/shiboken2/shibokenmodule/support/signature/loader.py
@@ -134,6 +134,21 @@ def formatannotation(annotation, base_module=None):
def _typevar__repr__(self):
return "typing." + self.__name__
+# Note also that during the tests we have a different encoding that would
+# break the Python license decorated files without an encoding line.
+
+# name used in signature.cpp
+def create_signature(props, key):
+ return layout.create_signature(props, key)
+
+# name used in signature.cpp
+def seterror_argument(args, func_name):
+ return errorhandler.seterror_argument(args, func_name)
+
+# name used in signature.cpp
+def make_helptext(func):
+ return errorhandler.make_helptext(func)
+
with ensure_import_support():
# We store all needed modules in signature_loader.
# This way, they are always accessible.
@@ -197,21 +212,10 @@ with ensure_import_support():
from support.signature.lib import enum_sig
put_into_loader_package(enum_sig)
from support.signature.parser import pyside_type_init
+ put_into_loader_package(pyside_type_init)
+ put_into_loader_package(create_signature)
+ put_into_loader_package(seterror_argument)
+ put_into_loader_package(make_helptext)
-# Note also that during the tests we have a different encoding that would
-# break the Python license decorated files without an encoding line.
-
-# name used in signature.cpp
-def create_signature(props, key):
- return layout.create_signature(props, key)
-
-# name used in signature.cpp
-def seterror_argument(args, func_name):
- return errorhandler.seterror_argument(args, func_name)
-
-# name used in signature.cpp
-def make_helptext(func):
- return errorhandler.make_helptext(func)
-
# end of file