From 93fbe408b529963ce244f399d5d00dba269ed33f Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Sun, 22 Aug 2010 17:24:57 -0500 Subject: [PATCH] fix core/config.py infinite reloading loop reported by monokrome --- core/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/config.py b/core/config.py index 1a4456a..abd064a 100644 --- a/core/config.py +++ b/core/config.py @@ -27,9 +27,11 @@ if not os.path.exists('config'): def config(): # reload config from file if file has changed - if bot._config_mtime != os.stat('config').st_mtime: + config_mtime = os.stat('config').st_mtime + if bot._config_mtime != config_mtime: try: bot.config = json.load(open('config')) + bot._config_mtime = config_mtime except ValueError, e: print 'ERROR: malformed config!', e