1
0
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:
Douglas Raillard 2023-06-26 10:46:53 +01:00 committed by Marc Bonnici
parent 306fd0624c
commit eb2c7e488b

View File

@ -22,11 +22,14 @@ import serial
# pylint: disable=import-error,wrong-import-position,ungrouped-imports,wrong-import-order # pylint: disable=import-error,wrong-import-position,ungrouped-imports,wrong-import-order
import pexpect import pexpect
from distutils.version import StrictVersion as V
if V(pexpect.__version__) < V('4.0.0'): try:
import fdpexpect
else:
from pexpect import fdpexpect 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 # 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