summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index cbac5f1..e63a8b6 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -340,7 +340,9 @@ def whichmodule(obj, name):
# Protect the iteration by using a list copy of sys.modules against dynamic
# modules that trigger imports of other modules upon calls to getattr.
for module_name, module in sys.modules.copy().items():
- if module_name == '__main__' or module is None:
+ if (module_name == '__main__'
+ or module_name == '__mp_main__' # bpo-42406
+ or module is None):
continue
try:
if _getattribute(module, name)[0] is obj: