From 031b7caa81cb7e5e3aa678fb493cee06296294e8 Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Thu, 9 Apr 2020 14:44:32 +0200 Subject: [PATCH] Add error hanling in bundled mode --- wexpect/host.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wexpect/host.py b/wexpect/host.py index f4654c0..4997d5c 100644 --- a/wexpect/host.py +++ b/wexpect/host.py @@ -355,6 +355,10 @@ class SpawnBase: dirname = os.path.dirname(sys.executable) wexpect_executable = os.path.join(dirname, '..', 'wexpect', 'wexpect.exe') + if not os.path.exists(wexpect_executable): + logger.error(f'ExceptionPexpect: Wexpect executable: >>{wexpect_executable}<< not found.') + raise ExceptionPexpect(f'Wexpect executable: >>{wexpect_executable}<< not found.') + commandLine = f'"{wexpect_executable}" {console_args}' else: