diff -Nru python-ws4py-0.4.2+dfsg1/debian/changelog python-ws4py-0.4.2+dfsg1/debian/changelog --- python-ws4py-0.4.2+dfsg1/debian/changelog 2017-11-22 14:29:35.000000000 +0000 +++ python-ws4py-0.4.2+dfsg1/debian/changelog 2018-07-29 07:01:36.000000000 +0000 @@ -1,3 +1,9 @@ +python-ws4py (0.4.2+dfsg1-2ubuntu1) cosmic; urgency=medium + + * Fix compatibility with Python 3.7. Closes: #903529. + + -- Matthias Klose Sun, 29 Jul 2018 09:01:36 +0200 + python-ws4py (0.4.2+dfsg1-2) unstable; urgency=medium * Team upload. diff -Nru python-ws4py-0.4.2+dfsg1/debian/patches/fix-py37-compat.diff python-ws4py-0.4.2+dfsg1/debian/patches/fix-py37-compat.diff --- python-ws4py-0.4.2+dfsg1/debian/patches/fix-py37-compat.diff 1970-01-01 00:00:00.000000000 +0000 +++ python-ws4py-0.4.2+dfsg1/debian/patches/fix-py37-compat.diff 2018-07-29 07:01:24.000000000 +0000 @@ -0,0 +1,81 @@ +Index: b/test/autobahn_test_servers.py +=================================================================== +--- a/test/autobahn_test_servers.py ++++ b/test/autobahn_test_servers.py +@@ -142,7 +142,7 @@ def run_python_wsgi(host="127.0.0.1", po + """ + run_python_wsgi_async(host, port, False) + +-def run_python_wsgi_async(host="127.0.0.1", port=9010, async=True): ++def run_python_wsgi_async(host="127.0.0.1", port=9010, async_=True): + """ + Runs wsgi server on python 2.x with async middleware" + """ +@@ -153,7 +153,7 @@ def run_python_wsgi_async(host="127.0.0. + from ws4py.server.wsgiutils import WebSocketWSGIApplication + + app = WebSocketWSGIApplication(handler_cls=EchoWebSocket) +- if async: ++ if async_: + def middleware(app): + def later(environ, start_response): + for part in app(environ, start_response): +Index: b/ws4py/async_websocket.py +=================================================================== +--- a/ws4py/async_websocket.py ++++ b/ws4py/async_websocket.py +@@ -18,6 +18,11 @@ delegated_generator_websocket_on_top_of_ + import asyncio + import types + ++try: # pragma: no cover ++ asyncio_ensure_future = asyncio.ensure_future # Python >= 3.5 ++except AttributeError: # pragma: no cover ++ asyncio_ensure_future = getattr(asyncio, 'async') # Python < 3.5 ++ + from ws4py.websocket import WebSocket as _WebSocket + from ws4py.messaging import Message + +@@ -84,7 +89,7 @@ class WebSocket(_WebSocket): + def closeit(): + yield from self.proto.writer.drain() + self.proto.writer.close() +- asyncio.async(closeit()) ++ asyncio.asyncio_ensure_future(closeit()) + + def _write(self, data): + """ +@@ -94,7 +99,7 @@ class WebSocket(_WebSocket): + def sendit(data): + self.proto.writer.write(data) + yield from self.proto.writer.drain() +- asyncio.async(sendit(data)) ++ asyncio.asyncio_ensure_future(sendit(data)) + + @asyncio.coroutine + def run(self): +Index: b/ws4py/server/tulipserver.py +=================================================================== +--- a/ws4py/server/tulipserver.py ++++ b/ws4py/server/tulipserver.py +@@ -6,6 +6,11 @@ import io + + import asyncio + ++try: # pragma: no cover ++ asyncio_ensure_future = asyncio.ensure_future # Python >= 3.5 ++except AttributeError: # pragma: no cover ++ asyncio_ensure_future = getattr(asyncio, 'async') # Python < 3.5 ++ + from ws4py import WS_KEY, WS_VERSION + from ws4py.exc import HandshakeError + from ws4py.websocket import WebSocket +@@ -40,7 +45,7 @@ class WebSocketProtocol(asyncio.StreamRe + #self.stream.set_transport(transport) + asyncio.StreamReaderProtocol.connection_made(self, transport) + # Let make it concurrent for others to tag along +- f = asyncio.async(self.handle_initial_handshake()) ++ f = asyncio.asyncio_ensure_future(self.handle_initial_handshake()) + f.add_done_callback(self.terminated) + + @property diff -Nru python-ws4py-0.4.2+dfsg1/debian/patches/series python-ws4py-0.4.2+dfsg1/debian/patches/series --- python-ws4py-0.4.2+dfsg1/debian/patches/series 2017-11-18 21:53:16.000000000 +0000 +++ python-ws4py-0.4.2+dfsg1/debian/patches/series 2018-07-29 06:52:07.000000000 +0000 @@ -1,2 +1,3 @@ 0001-Fix-tests.patch 0002-Make-intersphinx-use-object.inv-from-python-doc.patch +fix-py37-compat.diff