]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
asyncio_test: Fix compatibility with Python 3.7 nightlies
authorBen Darnell <ben@bendarnell.com>
Fri, 26 Jan 2018 23:03:58 +0000 (18:03 -0500)
committerBen Darnell <ben@bendarnell.com>
Fri, 26 Jan 2018 23:03:58 +0000 (18:03 -0500)
tornado/test/asyncio_test.py

index b08f065f10818642f6e6be5e56a6c483315e69c7..bbabb5212075bd4b1e560290d4aaccc8413bb1fd 100644 (file)
@@ -47,7 +47,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))