diff options
Diffstat (limited to 'Lib/asyncio/base_subprocess.py')
-rw-r--r-- | Lib/asyncio/base_subprocess.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py index b547c44..f503f78 100644 --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -120,10 +120,9 @@ class BaseSubprocessTransport(transports.SubprocessTransport): # Don't clear the _proc reference yet: _post_init() may still run - def __del__(self): + def __del__(self, _warn=warnings.warn): if not self._closed: - warnings.warn(f"unclosed transport {self!r}", ResourceWarning, - source=self) + _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) self.close() def get_pid(self): |