Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bcd76827
Commit
bcd76827
authored
Oct 20, 2013
by
Charles-François Natali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19309: asyncio: make waitpid() wait for all child processes, not only
those in the same process group.
parent
f3e21ba5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
Lib/asyncio/unix_events.py
Lib/asyncio/unix_events.py
+1
-1
Lib/test/test_asyncio/test_events.py
Lib/test/test_asyncio/test_events.py
+20
-0
No files found.
Lib/asyncio/unix_events.py
View file @
bcd76827
...
...
@@ -168,7 +168,7 @@ class SelectorEventLoop(selector_events.BaseSelectorEventLoop):
def
_sig_chld
(
self
):
try
:
try
:
pid
,
status
=
os
.
waitpid
(
0
,
os
.
WNOHANG
)
pid
,
status
=
os
.
waitpid
(
-
1
,
os
.
WNOHANG
)
except
ChildProcessError
:
return
if
pid
==
0
:
...
...
Lib/test/test_asyncio/test_events.py
View file @
bcd76827
...
...
@@ -1233,6 +1233,26 @@ class EventLoopTestsMixin:
self
.
loop
.
run_until_complete
(
proto
.
completed
)
self
.
assertEqual
(
-
signal
.
SIGTERM
,
proto
.
returncode
)
@
unittest
.
skipIf
(
sys
.
platform
==
'win32'
,
"Don't support subprocess for Windows yet"
)
def
test_subprocess_wait_no_same_group
(
self
):
proto
=
None
transp
=
None
@
tasks
.
coroutine
def
connect
():
nonlocal
proto
# start the new process in a new session
transp
,
proto
=
yield
from
self
.
loop
.
subprocess_shell
(
functools
.
partial
(
MySubprocessProtocol
,
self
.
loop
),
'exit 7'
,
stdin
=
None
,
stdout
=
None
,
stderr
=
None
,
start_new_session
=
True
)
self
.
assertIsInstance
(
proto
,
MySubprocessProtocol
)
self
.
loop
.
run_until_complete
(
connect
())
self
.
loop
.
run_until_complete
(
proto
.
completed
)
self
.
assertEqual
(
7
,
proto
.
returncode
)
if
sys
.
platform
==
'win32'
:
from
asyncio
import
windows_events
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment