X Tutup
Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Lib/multiprocessing/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def parent_process():
def _cleanup():
# check for processes which have finished
for p in list(_children):
if p._popen.poll() is not None:
if (child_popen := p._popen) and child_popen.poll() is not None:
_children.discard(p)

#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix a race condition in the internal :mod:`multiprocessing.process` cleanup
logic that could manifest as an unintended ``AttributeError`` when calling
``process.close()``.
X Tutup