mirror of
https://github.com/clearml/wexpect-venv
synced 2025-01-30 18:36:57 +00:00
Introduce WEXPECT_EXECUTABLE environment variable for pyinstaller
Last versions searched wexpect executable ../wexpect/wexpect.exe in bindled mode. This was hard coded. Now the (optional) WEXPECT_EXECUTABLE environment variable can point to wexpect executable. See #12 for more details.
This commit is contained in:
parent
8ce9059388
commit
af8d24df1d
@ -342,10 +342,20 @@ class SpawnBase:
|
||||
raise Exception(
|
||||
'`sys.frozen` found, but `sys._MEIPASS` not. Only pyinstaller is supported.'
|
||||
)
|
||||
dirname = os.path.dirname(sys.executable)
|
||||
|
||||
console_executable = os.path.join(dirname, '..', 'wexpect', 'wexpect.exe')
|
||||
commandLine = f'"{console_executable}" {console_args}'
|
||||
#
|
||||
# Find wexpect executable (aka. console reader executable).
|
||||
# User can point WEXPECT_EXECUTABLE environment variable to this executable, if this
|
||||
# env/var isn't specified we will find executable `../wexpect/wexpect.exe` relativly
|
||||
# from the host executable.
|
||||
#
|
||||
try:
|
||||
wexpect_executable = os.environ['WEXPECT_EXECUTABLE']
|
||||
except KeyError:
|
||||
dirname = os.path.dirname(sys.executable)
|
||||
wexpect_executable = os.path.join(dirname, '..', 'wexpect', 'wexpect.exe')
|
||||
|
||||
commandLine = f'"{wexpect_executable}" {console_args}'
|
||||
|
||||
else:
|
||||
'''Runing in a normal python process
|
||||
|
Loading…
Reference in New Issue
Block a user