Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Lib/multiprocessing/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,16 @@ def is_alive(self):
if self is _current_process:
return True
assert self._parent_pid == os.getpid(), 'can only test a child process'

if self._popen is None:
return False
self._popen.poll()
return self._popen.returncode is None

returncode = self._popen.poll()
if returncode is None:
return True
else:
_current_process._children.discard(self)
return False

@property
def name(self):
Expand Down