Skip to content

Commit 686d528

Browse files
authored
Fix pyinstaller hook for pyinstaller >= 4.0
Thanks to Brénainn Woodsend (https://github.com/bwoodsend) for the fix. See also cztomczak#600 .
1 parent 054ff3c commit 686d528

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

examples/pyinstaller/hook-cefpython3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
import sys
1515
import PyInstaller
1616
from PyInstaller.utils.hooks import is_module_satisfies, get_package_paths
17-
from PyInstaller.compat import is_win, is_darwin, is_linux, is_py2
17+
from PyInstaller.compat import is_win, is_darwin, is_linux
1818
from PyInstaller import log as logging
19+
try:
20+
# PyInstaller >= 4.0 doesn't support Python 2.7
21+
from PyInstaller.compat import is_py2
22+
except ImportError:
23+
is_py2 = None
1924

2025
# Constants
2126
CEFPYTHON_MIN_VERSION = "57.0"

0 commit comments

Comments
 (0)