From 13e3f80f8ab790293cae81afcf757b6a0b63b1d5 Mon Sep 17 00:00:00 2001 From: mmckerns Date: Thu, 16 Jun 2022 21:12:27 -0400 Subject: [PATCH] protect against sys.modules contents change --- dill/__diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dill/__diff.py b/dill/__diff.py index df2589eb..3ff65763 100644 --- a/dill/__diff.py +++ b/dill/__diff.py @@ -235,6 +235,6 @@ def _imp(*args, **kwds): # memorise all already imported modules. This implies that this must be # imported first for any changes to be recorded -for mod in sys.modules.values(): +for mod in list(sys.modules.values()): memorise(mod) release_gone()