summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2012-09-13 16:27:15 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2012-09-13 16:27:15 (GMT)
commite8cd6bb127698306ae25ed18c8cfe4fbfe7b6f15 (patch)
tree8a34835ed565766ce48e20666b996807563f9c2f /Lib/multiprocessing
parent0b90d66342469f7969d6e0cc3e5926cffaf566c5 (diff)
downloadcpython-e8cd6bb127698306ae25ed18c8cfe4fbfe7b6f15.zip
cpython-e8cd6bb127698306ae25ed18c8cfe4fbfe7b6f15.tar.gz
cpython-e8cd6bb127698306ae25ed18c8cfe4fbfe7b6f15.tar.bz2
Issue #15881: Clarify comment in exit function
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/util.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index 3bb9546..7495813 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -290,14 +290,17 @@ def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
if current_process() is not None:
# We check if the current process is None here because if
- # it's None, any call to ``active_children()`` will throw an
- # AttributeError (active_children winds up trying to get
- # attributes from util._current_process). This happens in a
- # variety of shutdown circumstances that are not well-understood
- # because module-scope variables are not apparently supposed to
- # be destroyed until after this function is called. However,
- # they are indeed destroyed before this function is called. See
- # issues #9775 and #15881. Also related: #4106, #9205, and #9207.
+ # it's None, any call to ``active_children()`` will throw
+ # an AttributeError (active_children winds up trying to
+ # get attributes from util._current_process). One
+ # situation where this can happen is if someone has
+ # manipulated sys.modules, causing this module to be
+ # garbage collected. The destructor for the module type
+ # then replaces all values in the module dict with None.
+ # For instance, after setuptools runs a test it replaces
+ # sys.modules with a copy created earlier. See issues
+ # #9775 and #15881. Also related: #4106, #9205, and
+ # #9207.
for p in active_children():
if p._daemonic: