Use object identity tests where needed

1.5
IceArmy 2011-12-11 22:59:50 -08:00
parent 8ade9f43a4
commit a300deabe8
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ def has_action(hook, func=None):
raise LookupError("Hook '%s' was not found" % hook)
for plugin in hooks[hook]['plugins']:
if plugin[1] == func:
if plugin[1] is func:
return True
return False
@ -124,7 +124,7 @@ def remove_action(hook, func=None, priority=10):
raise LookupError("Hook '%s' was not found" % hook)
for i, plugin in enumerate(hooks[hook]['plugins']):
if plugin[1] == func and plugin[0] == priority:
if plugin[1] is func and plugin[0] == priority:
del hooks[hook]['plugins'][i]
return True
return False