diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-09-22 23:24:35 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-09-22 23:24:35 +0200 |
commit | 16843852842bf0603b215ed93f8c0490571c8dbc (patch) | |
tree | 1250de18a41dfbd90727a93ee81f691c72c350b6 | |
parent | c2b26798cb0bf3a6db8f09a0e030dc725356fc48 (diff) | |
download | pyserial-16843852842bf0603b215ed93f8c0490571c8dbc.tar.gz |
fix deprecated function, unicode in test
-rw-r--r-- | serial/serialutil.py | 2 | ||||
-rw-r--r-- | 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__': |