Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 952d402

Browse files
committed
Sync tasks.py & base_events.py with CPython
1 parent 8bee0c0 commit 952d402

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

asyncio/base_events.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
to modify the meaning of the API call itself.
1414
"""
1515

16-
1716
import collections
1817
import concurrent.futures
1918
import heapq
@@ -1128,7 +1127,7 @@ def subprocess_shell(self, protocol_factory, cmd, *, stdin=subprocess.PIPE,
11281127
transport = yield from self._make_subprocess_transport(
11291128
protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
11301129
if self._debug:
1131-
logger.info('%s: %r' % (debug_log, transport))
1130+
logger.info('%s: %r', debug_log, transport)
11321131
return transport, protocol
11331132

11341133
@coroutine
@@ -1158,7 +1157,7 @@ def subprocess_exec(self, protocol_factory, program, *args,
11581157
protocol, popen_args, False, stdin, stdout, stderr,
11591158
bufsize, **kwargs)
11601159
if self._debug:
1161-
logger.info('%s: %r' % (debug_log, transport))
1160+
logger.info('%s: %r', debug_log, transport)
11621161
return transport, protocol
11631162

11641163
def get_exception_handler(self):

asyncio/tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def sleep(delay, result=None, *, loop=None):
519519
h.cancel()
520520

521521

522-
def async(coro_or_future, *, loop=None):
522+
def async_(coro_or_future, *, loop=None):
523523
"""Wrap a coroutine in a future.
524524
525525
If the argument is a Future, it is returned directly.
@@ -532,6 +532,11 @@ def async(coro_or_future, *, loop=None):
532532

533533
return ensure_future(coro_or_future, loop=loop)
534534

535+
# Silence DeprecationWarning:
536+
globals()['async'] = async_
537+
async_.__name__ = 'async'
538+
del async_
539+
535540

536541
def ensure_future(coro_or_future, *, loop=None):
537542
"""Wrap a coroutine or an awaitable in a future.

0 commit comments

Comments
 (0)