From 1cc1c93838ddae86ee6c1cacb467a92aac73b9a0 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sat, 31 Aug 2019 19:02:31 +0200 Subject: Fix Signature after Merging 5.14 Somehow, a few changes had diverged and needed fixing. No idea how this could have passed CI - was it deactivated? This checkin also changes the "*.inc" file names to "_inc.h" in favor of one developer's needs. Change-Id: I0687bc2ba542e07da796b9d0eebc0f16210e8387 Reviewed-by: Friedemann Kleint --- sources/shiboken2/libshiboken/CMakeLists.txt | 8 ++++---- sources/shiboken2/libshiboken/embed/embedding_generator.py | 4 ++-- sources/shiboken2/libshiboken/signature.cpp | 4 ++-- .../files.dir/shibokensupport/signature/lib/enum_sig.py | 13 ++++++++----- .../files.dir/shibokensupport/signature/mapping.py | 2 ++ 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/sources/shiboken2/libshiboken/CMakeLists.txt b/sources/shiboken2/libshiboken/CMakeLists.txt index 7cbb22978..0c2c67fe8 100644 --- a/sources/shiboken2/libshiboken/CMakeLists.txt +++ b/sources/shiboken2/libshiboken/CMakeLists.txt @@ -30,8 +30,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/embed/signature_bootstrap.py" "${CMAKE_CURRENT_BINARY_DIR}/embed/signature_bootstrap.py" @ONLY) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embed/signature_bootstrap.inc" - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embed/signature.inc" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embed/signature_bootstrap_inc.h" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embed/signature_inc.h" COMMAND ${PYTHON_EXECUTABLE} -E "${CMAKE_CURRENT_SOURCE_DIR}/embed/embedding_generator.py" --cmake-dir "${CMAKE_CURRENT_BINARY_DIR}/embed" @@ -62,8 +62,8 @@ pep384impl.cpp voidptr.cpp typespec.cpp bufferprocs_py37.cpp -embed/signature_bootstrap.inc -embed/signature.inc +embed/signature_bootstrap_inc.h +embed/signature_inc.h ) get_numpy_location() diff --git a/sources/shiboken2/libshiboken/embed/embedding_generator.py b/sources/shiboken2/libshiboken/embed/embedding_generator.py index 77aa5c329..15f63649b 100644 --- a/sources/shiboken2/libshiboken/embed/embedding_generator.py +++ b/sources/shiboken2/libshiboken/embed/embedding_generator.py @@ -88,7 +88,7 @@ def create_zipfile(limited_api): and make a chunked base64 encoded file from it. """ zip_name = "signature.zip" - inc_name = "signature.inc" + inc_name = "signature_inc.h" flag = '-b' if sys.version_info >= (3,) else '' os.chdir(work_dir) @@ -131,7 +131,7 @@ def create_zipfile(limited_api): tmp.close() # also generate a simple embeddable .pyc file for signature_bootstrap.pyc boot_name = "signature_bootstrap.py" if limited_api else "signature_bootstrap.pyc" - with open(boot_name, "rb") as ldr, open("signature_bootstrap.inc", "w") as inc: + with open(boot_name, "rb") as ldr, open("signature_bootstrap_inc.h", "w") as inc: _embed_bytefile(ldr, inc, limited_api) os.chdir(cur_dir) diff --git a/sources/shiboken2/libshiboken/signature.cpp b/sources/shiboken2/libshiboken/signature.cpp index 543ccac5f..746b026c4 100644 --- a/sources/shiboken2/libshiboken/signature.cpp +++ b/sources/shiboken2/libshiboken/signature.cpp @@ -455,11 +455,11 @@ GetSignature_Cached(PyObject *props, const char *func_kind, const char *modifier } static const char *PySide_CompressedSignaturePackage[] = { -#include "embed/signature.inc" +#include "embed/signature_inc.h" }; static const unsigned char PySide_SignatureLoader[] = { -#include "embed/signature_bootstrap.inc" +#include "embed/signature_bootstrap_inc.h" }; static safe_globals_struc * diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py index b026a5d20..b84a20e16 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py @@ -52,11 +52,6 @@ by producing a lot of clarity. import sys from shibokensupport.signature import inspect from shibokensupport.signature import get_signature -try: - from PySide2.QtCore import Qt - EnumType = type(Qt.Key) -except ImportError: - EnumType = None class ExactEnumerator(object): @@ -69,6 +64,14 @@ class ExactEnumerator(object): """ def __init__(self, formatter, result_type=dict): + global EnumType + try: + # Lazy import + from PySide2.QtCore import Qt + EnumType = type(Qt.Key) + except ImportError: + EnumType = None + self.fmt = formatter self.result_type = result_type self.fmt.level = 0 diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index d77d34f97..4d673549c 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -264,6 +264,7 @@ type_map = {} namespace = globals() # our module's __dict__ type_map.update({ + "...": ellipsis, "bool": bool, "char": Char, "char*": str, @@ -326,6 +327,7 @@ type_map.update({ "unsigned long": int, "unsigned short int": int, # 5.6, RHEL 6.6 "unsigned short": int, + "Unspecified": None, "ushort": int, "void": int, # be more specific? "WId": WId, -- cgit v1.2.3