From 16843852842bf0603b215ed93f8c0490571c8dbc Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Tue, 22 Sep 2015 23:24:35 +0200 Subject: fix deprecated function, unicode in test --- serial/serialutil.py | 2 +- test/test_iolib.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/serial/serialutil.py b/serial/serialutil.py index 1ccfabb..5fb5588 100644 --- a/serial/serialutil.py +++ b/serial/serialutil.py @@ -564,7 +564,7 @@ class SerialBase(io.RawIOBase): self.apply_settings(d) def isOpen(self): - return self._is_open + return self.is_open # - - - - - - - - - - - - - - - - - - - - - - - - # additional functionality diff --git a/test/test_iolib.py b/test/test_iolib.py index 37ee081..f5635f3 100644 --- a/test/test_iolib.py +++ b/test/test_iolib.py @@ -63,10 +63,10 @@ class Test_SerialAndIO(unittest.TestCase): self.s.close() def test_hello_raw(self): - self.io.write(r"hello\n") + self.io.write(b"hello\n".decode('utf-8')) self.io.flush() # it is buffering. required to get the data out hello = self.io.readline() - self.failUnlessEqual(hello, u"hello\n") + self.failUnlessEqual(hello, b"hello\n".decode('utf-8')) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if __name__ == '__main__': -- cgit v1.2.1