mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/serial_port: fix fdpexpect import for pexpect versions >= 4.0
The pexpect module exposes a fdpexpect class starting from version 4.0. This patch makes uses of the proper pxssh import statement depending on the version of pexpect available in the host. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
parent
c1d7cfafcc
commit
68e5e83864
@ -19,7 +19,13 @@ from contextlib import contextmanager
|
|||||||
from logging import Logger
|
from logging import Logger
|
||||||
|
|
||||||
import serial
|
import serial
|
||||||
import fdpexpect
|
|
||||||
|
import pexpect
|
||||||
|
from distutils.version import StrictVersion as V
|
||||||
|
if V(pexpect.__version__) < V('4.0.0'):
|
||||||
|
import fdpexpect
|
||||||
|
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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user