Skip to content

Commit

Permalink
Fix RuntimeError: dictionary changed size during iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Chen committed Aug 24, 2021
1 parent 87dfb1d commit f3074a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def flush(self):

if in_tox:
# When in tox, we shouldn't have any usercustomize messing this up.
for k in sys.modules.keys():
for k in list(sys.modules.keys()):
assert not k == "pyflyby" or k.startswith("pyflyby.")

import pyflyby
Expand All @@ -92,7 +92,7 @@ def flush(self):
# Unload any already-imported pyflyby. This could happen if the user's
# usercustomize imported pyflyby. That would probably be the "production"
# pyflyby rather than the one being developed & tested.
for k in sys.modules.keys():
for k in list(sys.modules.keys()):
if k == "pyflyby" or k.startswith("pyflyby."):
del sys.modules[k]

Expand Down

0 comments on commit f3074a3

Please sign in to comment.