Skip to content

Commit

Permalink
[pyinst] Fix for pyinstaller 5.8
Browse files Browse the repository at this point in the history
Fixes comment #1839 (comment)
  • Loading branch information
pukkandan committed Feb 12, 2023
1 parent 78a78fa commit 2e269bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyinst.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def set_version_info(exe, version):
def windows_set_version(exe, version):
from PyInstaller.utils.win32.versioninfo import (
FixedFileInfo,
SetVersion,
StringFileInfo,
StringStruct,
StringTable,
Expand All @@ -94,6 +93,11 @@ def windows_set_version(exe, version):
VSVersionInfo,
)

try:
from PyInstaller.utils.win32.versioninfo import SetVersion
except ImportError: # Pyinstaller >= 5.8
from PyInstaller.utils.win32.versioninfo import write_version_info_to_executable as SetVersion

version_list = version_to_list(version)
suffix = MACHINE and f'_{MACHINE}'
SetVersion(exe, VSVersionInfo(
Expand Down

0 comments on commit 2e269bd

Please sign in to comment.