diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-11 14:13:53 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-11 14:44:08 -0400 |
commit | 6c6a5e4a069229f808266fdc21ec10b31c41423d (patch) | |
tree | d3f820a3d255f907b9a00f0c01daa0b95cf81fb6 | |
parent | 53edb85e6e08765008595a39eb28b4c544baa326 (diff) | |
download | trollius-git-6c6a5e4a069229f808266fdc21ec10b31c41423d.tar.gz |
Use DeprecationWarning for async()
-rw-r--r-- | asyncio/tasks.py | 2 | ||||
-rw-r--r-- | tests/test_tasks.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/asyncio/tasks.py b/asyncio/tasks.py index 5840d2a..f617b62 100644 --- a/asyncio/tasks.py +++ b/asyncio/tasks.py @@ -506,7 +506,7 @@ def async(coro_or_future, *, loop=None): """ warnings.warn("asyncio.async() function is deprecated, use ensure_future()", - RuntimeWarning) + DeprecationWarning) return ensure_future(coro_or_future, loop=loop) diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 8c79983..4119085 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -158,7 +158,7 @@ class TaskTests(test_utils.TestCase): def test_async_warning(self): f = asyncio.Future(loop=self.loop) - with self.assertWarnsRegex(RuntimeWarning, + with self.assertWarnsRegex(DeprecationWarning, 'function is deprecated, use ensure_'): self.assertIs(f, asyncio.async(f)) |