summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/locks.py1
-rw-r--r--Lib/asyncio/queues.py10
-rw-r--r--Lib/asyncio/streams.py20
-rw-r--r--Lib/asyncio/subprocess.py2
-rw-r--r--Lib/asyncio/tasks.py2
-rw-r--r--Lib/asyncio/transports.py2
6 files changed, 25 insertions, 12 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index cc6f2bf..7a13279 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -3,7 +3,6 @@
__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
import collections
-import sys
from . import compat
from . import events
diff --git a/Lib/asyncio/queues.py b/Lib/asyncio/queues.py
index 3b4dc21..c55dd8b 100644
--- a/Lib/asyncio/queues.py
+++ b/Lib/asyncio/queues.py
@@ -1,11 +1,11 @@
"""Queues"""
-__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty',
- 'JoinableQueue']
+__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty']
import collections
import heapq
+from . import compat
from . import events
from . import futures
from . import locks
@@ -289,5 +289,7 @@ class LifoQueue(Queue):
return self._queue.pop()
-JoinableQueue = Queue
-"""Deprecated alias for Queue."""
+if not compat.PY35:
+ JoinableQueue = Queue
+ """Deprecated alias for Queue."""
+ __all__.append('JoinableQueue')
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index 6cd60c4..6484c43 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -6,7 +6,6 @@ __all__ = ['StreamReader', 'StreamWriter', 'StreamReaderProtocol',
]
import socket
-import sys
if hasattr(socket, 'AF_UNIX'):
__all__.extend(['open_unix_connection', 'start_unix_server'])
@@ -240,6 +239,7 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
def eof_received(self):
self._stream_reader.feed_eof()
+ return True
class StreamWriter:
@@ -321,6 +321,24 @@ class StreamReader:
self._transport = None
self._paused = False
+ def __repr__(self):
+ info = ['StreamReader']
+ if self._buffer:
+ info.append('%d bytes' % len(info))
+ if self._eof:
+ info.append('eof')
+ if self._limit != _DEFAULT_LIMIT:
+ info.append('l=%d' % self._limit)
+ if self._waiter:
+ info.append('w=%r' % self._waiter)
+ if self._exception:
+ info.append('e=%r' % self._exception)
+ if self._transport:
+ info.append('t=%r' % self._transport)
+ if self._paused:
+ info.append('paused')
+ return '<%s>' % ' '.join(info)
+
def exception(self):
return self._exception
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py
index 4600a9f..ead4039 100644
--- a/Lib/asyncio/subprocess.py
+++ b/Lib/asyncio/subprocess.py
@@ -1,10 +1,8 @@
__all__ = ['create_subprocess_exec', 'create_subprocess_shell']
-import collections
import subprocess
from . import events
-from . import futures
from . import protocols
from . import streams
from . import tasks
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 1d5f865..9bfc1cf 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -10,8 +10,6 @@ import concurrent.futures
import functools
import inspect
import linecache
-import sys
-import types
import traceback
import warnings
import weakref
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
index 7a28d90..70b323f 100644
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -1,7 +1,5 @@
"""Abstract Transport class."""
-import sys
-
from asyncio import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',