Skip to content

Commit

Permalink
Merge pull request #1152 from Bastian-Krause/bst/serialdriver-pyseria…
Browse files Browse the repository at this point in the history
…l-3.2.1

driver/serialdriver: drop handling of legacy pyserial 3.2.1
  • Loading branch information
Emantor committed Apr 26, 2023
2 parents 800cb89 + 3c744ce commit 7e4dea3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions labgrid/driver/serialdriver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging

import attr
from packaging import version
from pexpect import TIMEOUT
import serial
import serial.rfc2217
Expand All @@ -20,12 +19,7 @@ class SerialDriver(ConsoleExpectMixin, Driver, ConsoleProtocol):
"""
Driver implementing the ConsoleProtocol interface over a SerialPort connection
"""
# pyserial 3.2.1 does not support RFC2217 under Python 3
# https://github.com/pyserial/pyserial/pull/183
if version.parse(serial.__version__) <= version.Version('3.2.1'):
bindings = {"port": "SerialPort", }
else:
bindings = {"port": {"SerialPort", "NetworkSerialPort"}, }
bindings = {"port": {"SerialPort", "NetworkSerialPort"}, }

txdelay = attr.ib(default=0.0, validator=attr.validators.instance_of(float))
timeout = attr.ib(default=3.0, validator=attr.validators.instance_of(float))
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencies = [
"attrs==21.4.0",
"autobahn==21.3.1",
"jinja2==3.0.2",
"packaging==21.0",
"pexpect==4.8.0",
"pyserial-labgrid>=3.4.0.1",
"pytest==7.2.2",
Expand Down

0 comments on commit 7e4dea3

Please sign in to comment.