From b7b1d6d4e9c992661597b0336404d8ed40a774c0 Mon Sep 17 00:00:00 2001 From: Renato Araujo Date: Thu, 30 Sep 2021 06:04:29 -0700 Subject: [PATCH] Fixed unit test for PySide6 --- python/PyKDDockWidgets/__init__.py.cmake | 9 ++++++--- python/tests/config.py.cmake | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/PyKDDockWidgets/__init__.py.cmake b/python/PyKDDockWidgets/__init__.py.cmake index ff5c74dd..db56a6ea 100644 --- a/python/PyKDDockWidgets/__init__.py.cmake +++ b/python/PyKDDockWidgets/__init__.py.cmake @@ -18,10 +18,13 @@ def setupLibraryPath(): if sys.platform != 'win32': return - from shiboken2 import shiboken2 - from PySide@PYSIDE_MAJOR_VERSION@ import QtCore + if "@PYSIDE_MAJOR_VERSION@" == "6": + from shiboken@PYSIDE_MAJOR_VERSION@ import Shiboken + else: + from shiboken@PYSIDE_MAJOR_VERSION@ import shiboken@PYSIDE_MAJOR_VERSION@ as Shiboken - extra_dll_dirs = [ os.path.abspath(os.path.dirname(shiboken2.__file__)), + from PySide@PYSIDE_MAJOR_VERSION@ import QtCore + extra_dll_dirs = [ os.path.abspath(os.path.dirname(Shiboken.__file__)), os.path.abspath(os.path.dirname(QtCore.__file__)), os.path.abspath(os.path.dirname(__file__)) ] diff --git a/python/tests/config.py.cmake b/python/tests/config.py.cmake index a49a5c47..e904b38e 100644 --- a/python/tests/config.py.cmake +++ b/python/tests/config.py.cmake @@ -12,7 +12,7 @@ import os import sys class TstConfig(object): - bindingsNamespace = "@PYTHON_BINDING_NAMESPACE@" + bindingsNamespace = "PyKDDockWidgets" def initLibraryPath(): if sys.platform == 'win32' and sys.version_info[0] == 3 and sys.version_info[1] >= 8: