[Cryptech-Commits] [sw/libhal] branch master updated: Tornado 5.0 made an incompatible API change in iostream.BaseIOStream. Found when upgrading Ubuntu to 18.10.

git at cryptech.is git at cryptech.is
Thu Nov 1 19:11:25 UTC 2018


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

The following commit(s) were added to refs/heads/master by this push:
     new e017cb6  Tornado 5.0 made an incompatible API change in iostream.BaseIOStream. Found when upgrading Ubuntu to 18.10.
e017cb6 is described below

commit e017cb67f92d68200c8a838ee6f9ec0bc68f646e
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Thu Nov 1 15:10:51 2018 -0400

    Tornado 5.0 made an incompatible API change in iostream.BaseIOStream.
    Found when upgrading Ubuntu to 18.10.
---
 cryptech_muxd | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/cryptech_muxd b/cryptech_muxd
index 1aecb1e..ff40048 100755
--- a/cryptech_muxd
+++ b/cryptech_muxd
@@ -128,8 +128,16 @@ class SerialIOStream(tornado.iostream.BaseIOStream):
     def write_to_fd(self, data):
         return self.serial.write(data)
 
-    def read_from_fd(self):
-        return self.serial.read(self.read_chunk_size) or None
+    if tornado.version > "5":
+        # .. versionchanged:: 5.0
+        # Interface redesigned to take a buffer and return a number
+        # of bytes instead of a freshly-allocated object.
+        def read_from_fd(self, buf):
+            buf[:] = self.serial.read(len(buf))
+            return len(buf) or None
+    else:
+        def read_from_fd(self):
+            return self.serial.read(self.read_chunk_size) or None
 
 
 class PFUnixServer(tornado.tcpserver.TCPServer):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list