diff --git a/pexpect_serial/serial_spawn.py b/pexpect_serial/serial_spawn.py index c365c02..4c1726e 100644 --- a/pexpect_serial/serial_spawn.py +++ b/pexpect_serial/serial_spawn.py @@ -21,7 +21,13 @@ """ -from pexpect import spawn +# pexpect.spawn is not supported on some systems (i.e. Windows(TM)) +# See https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows for details. +import os +if os.name in ['nt']: + from pexpect.fdpexpect import fdspawn as spawn +else: + from pexpect import spawn from pexpect.exceptions import ExceptionPexpect __all__ = ['SerialSpawn'] diff --git a/requirements.txt b/requirements.txt index ba37da6..5c5a3cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ pyserial -pexpect +pexpect>=4 diff --git a/setup.py b/setup.py index f98b11c..a3e9daf 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name='pexpect-serial', - version='0.1.0', + version='0.2.0', author='High Wall', author_email='hiwall@126.com', description='pexpect with pyserial',