From 5f841b553814969220b096a2b4f959b7f6fcbaf6 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 9 Dec 2017 00:23:48 +0200 Subject: bpo-32193: Convert asyncio to async/await usage (#4753) * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test --- Lib/test/test_asyncio/test_unix_events.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Lib/test/test_asyncio/test_unix_events.py') diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 284c73d8daf..6746b34fe2c 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -77,9 +77,8 @@ class SelectorEventLoopSignalTests(test_utils.TestCase): def test_add_signal_handler_coroutine_error(self, m_signal): m_signal.NSIG = signal.NSIG - @asyncio.coroutine - def simple_coroutine(): - yield from [] + async def simple_coroutine(): + pass # callback must not be a coroutine function coro_func = simple_coroutine -- cgit v1.2.3