mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
asyncio: Truncate to 80 columns
This commit is contained in:
parent
8d9c145f61
commit
15cc678d89
12 changed files with 60 additions and 33 deletions
|
@ -201,8 +201,8 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
"""Create socket transport."""
|
||||
raise NotImplementedError
|
||||
|
||||
def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None, *,
|
||||
server_side=False, server_hostname=None,
|
||||
def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None,
|
||||
*, server_side=False, server_hostname=None,
|
||||
extra=None, server=None):
|
||||
"""Create SSL transport."""
|
||||
raise NotImplementedError
|
||||
|
|
|
@ -182,14 +182,18 @@ def _format_coroutine(coro):
|
|||
and not inspect.isgeneratorfunction(coro.func)):
|
||||
filename, lineno = events._get_function_source(coro.func)
|
||||
if coro.gi_frame is None:
|
||||
coro_repr = '%s() done, defined at %s:%s' % (coro_name, filename, lineno)
|
||||
coro_repr = ('%s() done, defined at %s:%s'
|
||||
% (coro_name, filename, lineno))
|
||||
else:
|
||||
coro_repr = '%s() running, defined at %s:%s' % (coro_name, filename, lineno)
|
||||
coro_repr = ('%s() running, defined at %s:%s'
|
||||
% (coro_name, filename, lineno))
|
||||
elif coro.gi_frame is not None:
|
||||
lineno = coro.gi_frame.f_lineno
|
||||
coro_repr = '%s() running at %s:%s' % (coro_name, filename, lineno)
|
||||
coro_repr = ('%s() running at %s:%s'
|
||||
% (coro_name, filename, lineno))
|
||||
else:
|
||||
lineno = coro.gi_code.co_firstlineno
|
||||
coro_repr = '%s() done, defined at %s:%s' % (coro_name, filename, lineno)
|
||||
coro_repr = ('%s() done, defined at %s:%s'
|
||||
% (coro_name, filename, lineno))
|
||||
|
||||
return coro_repr
|
||||
|
|
|
@ -55,8 +55,8 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
|
|||
return _SelectorSocketTransport(self, sock, protocol, waiter,
|
||||
extra, server)
|
||||
|
||||
def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None, *,
|
||||
server_side=False, server_hostname=None,
|
||||
def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter=None,
|
||||
*, server_side=False, server_hostname=None,
|
||||
extra=None, server=None):
|
||||
return _SelectorSslTransport(
|
||||
self, rawsock, protocol, sslcontext, waiter,
|
||||
|
@ -484,7 +484,8 @@ class _SelectorTransport(transports._FlowControlMixin,
|
|||
info.append('read=idle')
|
||||
|
||||
polling = _test_selector_event(self._loop._selector,
|
||||
self._sock_fd, selectors.EVENT_WRITE)
|
||||
self._sock_fd,
|
||||
selectors.EVENT_WRITE)
|
||||
if polling:
|
||||
state = 'polling'
|
||||
else:
|
||||
|
|
|
@ -68,7 +68,7 @@ class Task(futures.Future):
|
|||
return {t for t in cls._all_tasks if t._loop is loop}
|
||||
|
||||
def __init__(self, coro, *, loop=None):
|
||||
assert coroutines.iscoroutine(coro), repr(coro) # Not a coroutine function!
|
||||
assert coroutines.iscoroutine(coro), repr(coro)
|
||||
super().__init__(loop=loop)
|
||||
if self._source_traceback:
|
||||
del self._source_traceback[-1]
|
||||
|
|
|
@ -69,7 +69,8 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
"""
|
||||
if (coroutines.iscoroutine(callback)
|
||||
or coroutines.iscoroutinefunction(callback)):
|
||||
raise TypeError("coroutines cannot be used with add_signal_handler()")
|
||||
raise TypeError("coroutines cannot be used "
|
||||
"with add_signal_handler()")
|
||||
self._check_signal(sig)
|
||||
self._check_closed()
|
||||
try:
|
||||
|
|
|
@ -424,7 +424,8 @@ class IocpProactor:
|
|||
else:
|
||||
return windows_utils.PipeHandle(handle)
|
||||
|
||||
return self._register(ov, None, finish_connect_pipe, wait_for_post=True)
|
||||
return self._register(ov, None, finish_connect_pipe,
|
||||
wait_for_post=True)
|
||||
|
||||
def wait_for_handle(self, handle, timeout=None):
|
||||
"""Wait for a handle.
|
||||
|
|
|
@ -36,15 +36,16 @@ else:
|
|||
def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
|
||||
"""A socket pair usable as a self-pipe, for Windows.
|
||||
|
||||
Origin: https://gist.github.com/4325783, by Geert Jansen. Public domain.
|
||||
Origin: https://gist.github.com/4325783, by Geert Jansen.
|
||||
Public domain.
|
||||
"""
|
||||
if family == socket.AF_INET:
|
||||
host = '127.0.0.1'
|
||||
elif family == socket.AF_INET6:
|
||||
host = '::1'
|
||||
else:
|
||||
raise ValueError("Only AF_INET and AF_INET6 socket address families "
|
||||
"are supported")
|
||||
raise ValueError("Only AF_INET and AF_INET6 socket address "
|
||||
"families are supported")
|
||||
if type != socket.SOCK_STREAM:
|
||||
raise ValueError("Only SOCK_STREAM socket type is supported")
|
||||
if proto != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue