don't shadow locals() with a variable

This commit is contained in:
Ryan Hitchman 2009-04-17 19:34:16 -06:00
parent 5c9c8704c2
commit 666a2fe3ce
1 changed files with 3 additions and 3 deletions

6
bot.py
View File

@ -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]