diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:21:06 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:21:06 (GMT) |
commit | 934fa344c8f328498c03a8eafed8cc404ffcbef2 (patch) | |
tree | 153d94289c3a43f8099b2e92aeb7b5ae8f1472df /Lib/asyncio/base_subprocess.py | |
parent | 151b23562ea6105f79d8c4b5d5fe42bb61813d96 (diff) | |
parent | f2e43cbbd4b9325da638a6b45b52e766ca91b131 (diff) | |
download | cpython-934fa344c8f328498c03a8eafed8cc404ffcbef2.zip cpython-934fa344c8f328498c03a8eafed8cc404ffcbef2.tar.gz cpython-934fa344c8f328498c03a8eafed8cc404ffcbef2.tar.bz2 |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/asyncio/base_subprocess.py')
-rw-r--r-- | Lib/asyncio/base_subprocess.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py index 70676ab..02b9e89 100644 --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -84,6 +84,8 @@ class BaseSubprocessTransport(transports.SubprocessTransport): raise NotImplementedError def close(self): + if self._closed: + return self._closed = True for proto in self._pipes.values(): @@ -100,8 +102,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): except ProcessLookupError: pass - # Don't clear the _proc reference yet because _post_init() may - # still run + # Don't clear the _proc reference yet: _post_init() may still run # On Python 3.3 and older, objects with a destructor part of a reference # cycle are never destroyed. It's not more the case on Python 3.4 thanks @@ -125,8 +126,6 @@ class BaseSubprocessTransport(transports.SubprocessTransport): return None def _check_proc(self): - if self._closed: - raise ValueError("operation on closed transport") if self._proc is None: raise ProcessLookupError() |