mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	asyncio: sync with github
* Fix ResourceWarning warnings in test_streams * Return True from StreamReader.eof_received() to fix http://bugs.python.org/issue24539 (but still needs a unittest). Add StreamReader.__repr__() for easy debugging. * remove unused imports * Issue #234: Drop JoinableQueue on Python 3.5+
This commit is contained in:
		
							parent
							
								
									71080fc351
								
							
						
					
					
						commit
						eaf16abc68
					
				
					 7 changed files with 37 additions and 28 deletions
				
			
		|  | @ -6,7 +6,6 @@ | |||
|            ] | ||||
| 
 | ||||
| import socket | ||||
| import sys | ||||
| 
 | ||||
| if hasattr(socket, 'AF_UNIX'): | ||||
|     __all__.extend(['open_unix_connection', 'start_unix_server']) | ||||
|  | @ -240,6 +239,7 @@ def data_received(self, data): | |||
| 
 | ||||
|     def eof_received(self): | ||||
|         self._stream_reader.feed_eof() | ||||
|         return True | ||||
| 
 | ||||
| 
 | ||||
| class StreamWriter: | ||||
|  | @ -321,6 +321,24 @@ def __init__(self, limit=_DEFAULT_LIMIT, loop=None): | |||
|         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 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner