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: