From b235f583d4d534c4131aed5ff812ef830392f983 Mon Sep 17 00:00:00 2001 From: Evgeniy Dobrohvalov Date: Thu, 2 Apr 2015 16:49:36 +0300 Subject: [PATCH] Fixed autoreload for Python 3 Changed th system module values check to return a list. In Python 3 it returns a dict_view which could occassionally produce a runtime error of "dictionary changed size during iteration". --- tornado/autoreload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/autoreload.py b/tornado/autoreload.py index 8856b8c77..a52ddde40 100644 --- a/tornado/autoreload.py +++ b/tornado/autoreload.py @@ -175,7 +175,7 @@ def _reload_on_update(modify_times): # processes restarted themselves, they'd all restart and then # all call fork_processes again. return - for module in sys.modules.values(): + for module in list(sys.modules.values()): # Some modules play games with sys.modules (e.g. email/__init__.py # in the standard library), and occasionally this can cause strange # failures in getattr. Just ignore anything that's not an ordinary -- 2.47.2