mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
devlib/utils/serial_port: Avoid use of deprecated disutils
This commit is contained in:
parent
306fd0624c
commit
eb2c7e488b
@ -22,11 +22,14 @@ import serial
|
||||
|
||||
# pylint: disable=import-error,wrong-import-position,ungrouped-imports,wrong-import-order
|
||||
import pexpect
|
||||
from distutils.version import StrictVersion as V
|
||||
if V(pexpect.__version__) < V('4.0.0'):
|
||||
import fdpexpect
|
||||
else:
|
||||
|
||||
try:
|
||||
from pexpect import fdpexpect
|
||||
# pexpect < 4.0.0 does not have fdpexpect module
|
||||
except ImportError:
|
||||
import fdpexpect
|
||||
|
||||
|
||||
# Adding pexpect exceptions into this module's namespace
|
||||
from pexpect import EOF, TIMEOUT # NOQA pylint: disable=W0611
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user