From 11762aaa0aaa13ea23cffbb689417041165746e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Thu, 19 Oct 2023 17:51:55 +0200 Subject: [PATCH] Patch also PySide6 and not only PyQt5 --- package/pyinstaller/pyinstaller.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/package/pyinstaller/pyinstaller.spec b/package/pyinstaller/pyinstaller.spec index c570efaf2..d346692b5 100644 --- a/package/pyinstaller/pyinstaller.spec +++ b/package/pyinstaller/pyinstaller.spec @@ -414,7 +414,10 @@ for fname in script_n: # patch silx if SILX: - fname = os.path.join(DISTDIR, script_n[0], "silx", "gui","qt","_qt.py") + if sys.platform.startswith("darwin") and PyInstaller.__version__ >= '6.0.0': + fname = os.path.join(DISTDIR, script_n[0], "special_modules", "silx", "gui","qt","_qt.py") + else: + fname = os.path.join(DISTDIR, script_n[0], "silx", "gui","qt","_qt.py") if os.path.exists(fname): logger.info("###################################################################") logger.info("Patching silx") @@ -425,8 +428,17 @@ if SILX: f.close() f = open(fname, "w") for line in content: - f.write(line.replace("from PyQt5.uic import loadUi", "pass")) + #f.write(line.replace("from PyQt5.uic import loadUi", "pass")) + if "import loadUi" in line: + f.write(line.replace("from ", "pass #")) + else: + f.write(line) f.close() + else: + logger.info("###################################################################") + logger.info("Cannot patch silx. File not found") + logger.info(fname) + logger.info("###################################################################") # patch OpenCL if OPENCL: