mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 02:15:10 +00:00 
			
		
		
		
	 915bcb0111
			
		
	
	
		915bcb0111
		
	
	
	
	
		
			
			* Add a new asyncio.subprocess module * Add new create_subprocess_exec() and create_subprocess_shell() functions * The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers for stdout and stderr and a stream writer for stdin. * The new asyncio.subprocess.Process class offers an API close to the subprocess.Popen class: - pid, returncode, stdin, stdout and stderr attributes - communicate(), wait(), send_signal(), terminate() and kill() methods * Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess and unix_events, to not be confused with the symbols with the same name of subprocess and asyncio.subprocess modules * _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size of the pending write * _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if the write buffer size is greater than the high water mark (64 KB by default)
		
			
				
	
	
		
			45 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| """The asyncio package, tracking PEP 3156."""
 | |
| 
 | |
| import sys
 | |
| 
 | |
| # The selectors module is in the stdlib in Python 3.4 but not in 3.3.
 | |
| # Do this first, so the other submodules can use "from . import selectors".
 | |
| # Prefer asyncio/selectors.py over the stdlib one, as ours may be newer.
 | |
| try:
 | |
|     from . import selectors
 | |
| except ImportError:
 | |
|     import selectors  # Will also be exported.
 | |
| 
 | |
| if sys.platform == 'win32':
 | |
|     # Similar thing for _overlapped.
 | |
|     try:
 | |
|         from . import _overlapped
 | |
|     except ImportError:
 | |
|         import _overlapped  # Will also be exported.
 | |
| 
 | |
| # This relies on each of the submodules having an __all__ variable.
 | |
| from .events import *
 | |
| from .futures import *
 | |
| from .locks import *
 | |
| from .protocols import *
 | |
| from .queues import *
 | |
| from .streams import *
 | |
| from .subprocess import *
 | |
| from .tasks import *
 | |
| from .transports import *
 | |
| 
 | |
| if sys.platform == 'win32':  # pragma: no cover
 | |
|     from .windows_events import *
 | |
| else:
 | |
|     from .unix_events import *  # pragma: no cover
 | |
| 
 | |
| 
 | |
| __all__ = (events.__all__ +
 | |
|            futures.__all__ +
 | |
|            locks.__all__ +
 | |
|            protocols.__all__ +
 | |
|            queues.__all__ +
 | |
|            streams.__all__ +
 | |
|            subprocess.__all__ +
 | |
|            tasks.__all__ +
 | |
|            transports.__all__)
 |