Skip to content

Commit 85043d2

Browse files
committed
Fix reading versioninfo for PyInstaller 5.8.0
Fix #1064
1 parent 13f7d45 commit 85043d2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

sdk/python/packages/flet/src/flet/__pyinstaller/win_utils.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@
55

66
import packaging.version as version
77
import pefile
8+
import PyInstaller.utils.win32.versioninfo as versioninfo
89
from PyInstaller.building.icon import normalize_icon_type
910
from PyInstaller.compat import win32api
1011
from PyInstaller.utils.win32.icon import IconFile, normalize_icon_type
1112

12-
try:
13-
# PyInstaller 5.7.0
14-
from PyInstaller.utils.win32.versioninfo import decode
15-
except ImportError:
16-
# PyInstaller 5.8.0
17-
from PyInstaller.utils.misc import decode
18-
1913

2014
def update_flet_view_icon(exe_path, icon_path):
2115
print("Updating Flet View icon", exe_path, icon_path)
@@ -59,7 +53,10 @@ def update_flet_view_version_info(
5953
print("Updating Flet View version info", exe_path)
6054

6155
# load versioninfo from exe
62-
vs = decode(exe_path)
56+
if versioninfo.read_version_info_from_executable:
57+
vs = versioninfo.read_version_info_from_executable(exe_path)
58+
else:
59+
vs = versioninfo.decode(exe_path)
6360

6461
# update file version
6562
if file_version:

0 commit comments

Comments
 (0)