Skip to content

Commit

Permalink
Merge pull request #949 from jcjaskula-aws/jcjaskula-aws/copy_sys_module
Browse files Browse the repository at this point in the history
Use a copy of sys.module when iterating over
  • Loading branch information
newville authored Apr 7, 2024
2 parents 8781a2d + 04b66d2 commit cf2626b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmfit/jsonutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def find_importer(obj):
"""Find importer of an object."""
oname = obj.__name__
for modname, module in sys.modules.items():
for modname, module in sys.modules.copy().items():
if modname.startswith('__main__'):
continue
t = getattr(module, oname, None)
Expand Down

0 comments on commit cf2626b

Please sign in to comment.