diff options
Diffstat (limited to 'sources/pyside6/PySide6')
| -rw-r--r-- | sources/pyside6/PySide6/__init__.py.in | 13 | ||||
| -rw-r--r-- | sources/pyside6/PySide6/support/__init__.py | 2 | ||||
| -rw-r--r-- | sources/pyside6/PySide6/support/generate_pyi.py | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/sources/pyside6/PySide6/__init__.py.in b/sources/pyside6/PySide6/__init__.py.in index 9b86c1830..a0b9699f2 100644 --- a/sources/pyside6/PySide6/__init__.py.in +++ b/sources/pyside6/PySide6/__init__.py.in @@ -54,10 +54,12 @@ def _setupQtDirectories(): os.add_dll_directory(dir) try: - import shiboken6 + # PYSIDE-1497: we use the build dir or install dir or site-packages, whatever the path + # setting dictates. There is no longer a difference in path structure. + from shiboken6 import Shiboken except Exception: paths = ', '.join(sys.path) - print(f"PySide6/__init__.py: Unable to import shiboken6 from {paths}", + print(f"PySide6/__init__.py: Unable to import Shiboken from {paths}", file=sys.stderr) raise @@ -66,16 +68,17 @@ def _setupQtDirectories(): # PYSIDE-829: Avoid non-existent attributes in compiled code (Nuitka). # We now use an explicit function instead of touching a signature. _init_pyside_extension() - except AttributeError: + except (AttributeError, NameError): stars = 79 * "*" + fname = Shiboken.__file__ print(dedent(f'''\ {stars} PySide6/__init__.py: The `signature` module was not initialized. This libshiboken module was loaded from - "{shiboken6.__file__}". + "{fname}". - Please make sure that this is the real shiboken6 binary and not just a folder. + Please make sure that this is the real Shiboken binary and not just a folder. {stars} '''), file=sys.stderr) raise diff --git a/sources/pyside6/PySide6/support/__init__.py b/sources/pyside6/PySide6/support/__init__.py index 996acb05a..7d8c808aa 100644 --- a/sources/pyside6/PySide6/support/__init__.py +++ b/sources/pyside6/PySide6/support/__init__.py @@ -37,6 +37,6 @@ ## ############################################################################# -from shiboken6 import VoidPtr +from shiboken6.Shiboken import VoidPtr #eof diff --git a/sources/pyside6/PySide6/support/generate_pyi.py b/sources/pyside6/PySide6/support/generate_pyi.py index 32f43d804..8abab35f0 100644 --- a/sources/pyside6/PySide6/support/generate_pyi.py +++ b/sources/pyside6/PySide6/support/generate_pyi.py @@ -145,7 +145,7 @@ class Formatter(Writer): self.print() self.print("class Object(object): pass") self.print() - self.print("import shiboken6 as Shiboken") + self.print("from shiboken6 import Shiboken") self.print("Shiboken.Object = Object") self.print() # This line will be replaced by the missing imports postprocess. |
