From 666a2fe3ce69433d7670f14987b7c0ad79f0b660 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 17 Apr 2009 19:34:16 -0600 Subject: [PATCH] don't shadow locals() with a variable --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 81b86b5..8cc155e 100755 --- a/bot.py +++ b/bot.py @@ -44,8 +44,8 @@ def reload_plugins(): if mtime != plugin_mtimes.get(filename): try: code = compile(open(filename, 'U').read(), filename, 'exec') - locals = {} - eval(code, locals) + namespace = {} + eval(code, namespace) except Exception, e: print ' error:', e continue @@ -54,7 +54,7 @@ def reload_plugins(): for name, data in bot.plugs.iteritems(): bot.plugs[name] = filter(lambda x: x[0][0] != filename, data) - for obj in locals.itervalues(): + for obj in namespace.itervalues(): if hasattr(obj, '_skybot_hook'): #check for magic for type, data in obj._skybot_hook: bot.plugs[type] += [data]