From 606a54cc890b345fc001b603a23f7990c9c58407 Mon Sep 17 00:00:00 2001 From: Antti Haapala Date: Sun, 16 Feb 2014 16:13:39 +0200 Subject: Fix pserve --reload on Py3 (the simple solution) This is the simpler fix for `pserve --reload` (so please pull either https://github.com/Pylons/pyramid/pull/1244 or this). Basically with some project setups the reloader thread is guaranteed to crash on Python 3 as the main thread is importing modules in the other thread. --- pyramid/scripts/pserve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index 03cbc23ab..ea125a0dd 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -811,7 +811,7 @@ class Monitor(object): # pragma: no cover print( "Error calling reloader callback %r:" % file_callback) traceback.print_exc() - for module in sys.modules.values(): + for module in list(sys.modules.values()): try: filename = module.__file__ except (AttributeError, ImportError): -- cgit v1.2.3