aboutsummaryrefslogtreecommitdiffstats
path: root/pyinst.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2023-02-12 18:43:07 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2023-02-12 18:43:21 +0530
commit2e269bd998c61efaf7500907d114a56e5e83e65e (patch)
tree1cb54d28393f31e13ae893d75d0baba0cc35ec3b /pyinst.py
parent78a78fa74dbc888d20f1b65e1382bf99131597d5 (diff)
downloadhypervideo-pre-2e269bd998c61efaf7500907d114a56e5e83e65e.tar.lz
hypervideo-pre-2e269bd998c61efaf7500907d114a56e5e83e65e.tar.xz
hypervideo-pre-2e269bd998c61efaf7500907d114a56e5e83e65e.zip
[pyinst] Fix for pyinstaller 5.8
Fixes comment https://github.com/yt-dlp/yt-dlp/issues/1839#issuecomment-1427002271
Diffstat (limited to 'pyinst.py')
-rw-r--r--pyinst.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pyinst.py b/pyinst.py
index 22df672c9..c36f6acd4 100644
--- a/pyinst.py
+++ b/pyinst.py
@@ -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,
@@ -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(