diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py index 9c2ba679ce2bf1..6dbde2b696ad1f 100644 --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -1,9 +1,6 @@ import collections import subprocess import warnings -import os -import signal -import sys from . import protocols from . import transports @@ -145,31 +142,17 @@ def _check_proc(self): if self._proc is None: raise ProcessLookupError() - if sys.platform == 'win32': - def send_signal(self, signal): - self._check_proc() - self._proc.send_signal(signal) - - def terminate(self): - self._check_proc() - self._proc.terminate() - - def kill(self): - self._check_proc() - self._proc.kill() - else: - def send_signal(self, signal): - self._check_proc() - try: - os.kill(self._proc.pid, signal) - except ProcessLookupError: - pass + def send_signal(self, signal): + self._check_proc() + self._proc.send_signal(signal) - def terminate(self): - self.send_signal(signal.SIGTERM) + def terminate(self): + self._check_proc() + self._proc.terminate() - def kill(self): - self.send_signal(signal.SIGKILL) + def kill(self): + self._check_proc() + self._proc.kill() async def _connect_pipes(self, waiter): try: