Skip to content

Commit

Permalink
Patch also PySide6 and not only PyQt5
Browse files Browse the repository at this point in the history
  • Loading branch information
vasole committed Oct 19, 2023
1 parent 2a44a37 commit 11762aa
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions package/pyinstaller/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand Down

0 comments on commit 11762aa

Please sign in to comment.