summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-08-05 02:58:37 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-08-05 02:58:37 +0000
commitf3e5077d7a47ad81132c7864656a632a2ab787a3 (patch)
treef698f8eea885abf913b5ba9bccebadcd4c933b13
parent3da62c4274dac5f6bc426988b8033c1329b9acc3 (diff)
downloadpyserial-f3e5077d7a47ad81132c7864656a632a2ab787a3.tar.gz
implement patch 3147043
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@407 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r--CHANGES.txt1
-rw-r--r--serial/serialutil.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 82c3605..fef89f1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -413,6 +413,7 @@ Bugfixes:
- [Bug 3093882] calling open() on an already open port now raises an exception
- [Bug 3245627] connection-lost let rfc2217 hangs in closed loop
+- [Patch 3147043] readlines() to support multi-character eol
Bugfixes (posix):
diff --git a/serial/serialutil.py b/serial/serialutil.py
index 1d8714d..c372280 100644
--- a/serial/serialutil.py
+++ b/serial/serialutil.py
@@ -160,12 +160,13 @@ class FileLike(object):
sizehint is ignored."""
if self.timeout is None:
raise ValueError("Serial port MUST have enabled timeout for this function!")
+ leneol = len(eol)
lines = []
while True:
line = self.readline(eol=eol)
if line:
lines.append(line)
- if line[-1] != eol: # was the line received with a timeout?
+ if line[-leneol:] != eol: # was the line received with a timeout?
break
else:
break