Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a50f0b8

Browse filesBrowse files
committed
Partially revert "pythongh-87744: fix waitpid race while calling send_signal in asyncio (python#121126)"
This reverts the non-test changes of commit bd473aa.
1 parent d6b3e78 commit a50f0b8
Copy full SHA for a50f0b8

File tree

Expand file treeCollapse file tree

1 file changed

+9
-26
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-26
lines changed

‎Lib/asyncio/base_subprocess.py

Copy file name to clipboardExpand all lines: Lib/asyncio/base_subprocess.py
+9-26Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import collections
22
import subprocess
33
import warnings
4-
import os
5-
import signal
6-
import sys
74

85
from . import protocols
96
from . import transports
@@ -145,31 +142,17 @@ def _check_proc(self):
145142
if self._proc is None:
146143
raise ProcessLookupError()
147144

148-
if sys.platform == 'win32':
149-
def send_signal(self, signal):
150-
self._check_proc()
151-
self._proc.send_signal(signal)
152-
153-
def terminate(self):
154-
self._check_proc()
155-
self._proc.terminate()
156-
157-
def kill(self):
158-
self._check_proc()
159-
self._proc.kill()
160-
else:
161-
def send_signal(self, signal):
162-
self._check_proc()
163-
try:
164-
os.kill(self._proc.pid, signal)
165-
except ProcessLookupError:
166-
pass
145+
def send_signal(self, signal):
146+
self._check_proc()
147+
self._proc.send_signal(signal)
167148

168-
def terminate(self):
169-
self.send_signal(signal.SIGTERM)
149+
def terminate(self):
150+
self._check_proc()
151+
self._proc.terminate()
170152

171-
def kill(self):
172-
self.send_signal(signal.SIGKILL)
153+
def kill(self):
154+
self._check_proc()
155+
self._proc.kill()
173156

174157
async def _connect_pipes(self, waiter):
175158
try:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.