Skip to content

Commit

Permalink
Use copy of sys.modules.items() to avoid runtime error
Browse files Browse the repository at this point in the history
This shouldn't have any downsides and should ensure reported
`RuntimeError: dictionary changed size during iteration` errors are
fixed.
  • Loading branch information
pgjones committed Jul 29, 2018
1 parent dbd0234 commit 0c64f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quart/flask_patch/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _patch_modules() -> None:
# flask_patch namespace over simple references to the Quart
# versions.
flask_modules = {}
for name, module in sys.modules.items():
for name, module in list(sys.modules.items()):
if name.startswith('quart.flask_patch._'):
continue
elif name.startswith('quart.flask_patch'):
Expand Down

0 comments on commit 0c64f50

Please sign in to comment.