From: Evgeniy Dobrohvalov Date: Thu, 2 Apr 2015 13:49:36 +0000 (+0300) Subject: Fixed autoreload for Python 3 X-Git-Tag: v4.2.0b1~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b235f583d4d534c4131aed5ff812ef830392f983;p=thirdparty%2Ftornado.git 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". --- 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