diff options
author | Alberto Sottile <alby128@gmail.com> | 2019-02-22 11:23:48 +0100 |
---|---|---|
committer | Alberto Sottile <alby128@gmail.com> | 2019-02-22 13:52:50 +0000 |
commit | f324cced79a004d6ecb698a01189500384d0f966 (patch) | |
tree | 06ba24052f51728472bad0122c20ee0dbed54318 /sources/shiboken2/shibokenmodule/support | |
parent | 4c48e8e53fc566270bb639f09bb2de3d5ddbd5cf (diff) |
Fix error when importing signatures in frozen executables
Attempts to load the module directly from Python if loading it manually from
the .py file fails. This exposes the support submodule to installers. The
loader.py module was also patched to allow direct import from installers.
Change-Id: If225ae7a2e916912a581e09d1a02c18fd3a17526
Fixes: PYSIDE-942
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/shibokenmodule/support')
-rw-r--r-- | sources/shiboken2/shibokenmodule/support/signature/loader.py | 34 |
1 files changed, 19 insertions, 15 deletions
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 |