Skip to content

Commit

Permalink
www/py-tornado4: Fix build with Python 3.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Mar 25, 2022
1 parent 28cef7a commit ddbc3dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions www/py-tornado4/files/patch-tornado-test-asyncio_test.py
@@ -0,0 +1,12 @@
--- tornado/test/asyncio_test.py.orig 2018-01-05 03:07:44 UTC
+++ tornado/test/asyncio_test.py
@@ -46,7 +46,8 @@ class AsyncIOLoopTest(AsyncTestCase):
if hasattr(asyncio, 'ensure_future'):
ensure_future = asyncio.ensure_future
else:
- ensure_future = asyncio.async
+ # async is a reserved word in Python 3.7
+ ensure_future = getattr(asyncio, "async")

x = yield ensure_future(
asyncio.get_event_loop().run_in_executor(None, lambda: 42))

0 comments on commit ddbc3dc

Please sign in to comment.