Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update asyncio.async() to use asyncio.ensure_future() #6

Closed
FirefighterBlu3 opened this issue Jul 7, 2016 · 2 comments
Closed

update asyncio.async() to use asyncio.ensure_future() #6

FirefighterBlu3 opened this issue Jul 7, 2016 · 2 comments

Comments

@FirefighterBlu3
Copy link

  File "/usr/lib/python3.5/site-packages/janus-0.2.1-py3.5.egg/janus/__init__.py", line 147, in task_maker
    task = asyncio.async(f(), loop=self._loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 530, in async
    DeprecationWarning)
  File "/var/bluelabs/python/wampcams.py", line 24, in warn_with_traceback
    traceback.print_stack()
/usr/lib/python3.5/asyncio/tasks.py:530: DeprecationWarning: asyncio.async() function is deprecated, use ensure_future()
  DeprecationWarning)
@FirefighterBlu3
Copy link
Author

--- janus/__init__.py.orig  2016-07-06 05:17:40.000000000 +0000
+++ janus/__init__.py   2016-07-07 04:52:08.375292307 +0000
@@ -128,7 +128,7 @@
                 self._async_not_empty.notify()

         def task_maker():
-            task = asyncio.async(f(), loop=self._loop)
+            task = asyncio.ensure_future(f(), loop=self._loop)
             task.add_done_callback(self._pending.discard)
             self._pending.add(task)

@@ -144,7 +144,7 @@
                 self._async_not_full.notify()

         def task_maker():
-            task = asyncio.async(f(), loop=self._loop)
+            task = asyncio.ensure_future(f(), loop=self._loop)
             task.add_done_callback(self._pending.discard)
             self._pending.add(task)

@asvetlov
Copy link
Member

fixed in janus==0.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants