1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00

serial_port: updating to handle newer versions of pexpect

from version 4.0.0 onwards, fdpexpect is now namespaced under the main
pexpect libarary, rather than being stand-alone.
This commit is contained in:
Sergei Trofimov 2015-10-16 17:38:19 +01:00
parent 7546232c10
commit 691c380779

View File

@ -16,9 +16,15 @@
import time import time
from contextlib import contextmanager from contextlib import contextmanager
from distutils.version import StrictVersion as V
import serial import serial
import fdpexpect import pexpect
if V(pexpect.__version__) < V('4.0.0'):
import fdpexpect # pylint: disable=import-error
else:
from pexpect import fdpexpect
# Adding pexpect exceptions into this module's namespace # Adding pexpect exceptions into this module's namespace
from pexpect import EOF, TIMEOUT # NOQA pylint: disable=W0611 from pexpect import EOF, TIMEOUT # NOQA pylint: disable=W0611