From a300deabe8bf8eaf1351b74859c2e289ca4f7d1f Mon Sep 17 00:00:00 2001 From: IceArmy Date: Sun, 11 Dec 2011 22:59:50 -0800 Subject: [PATCH] Use object identity tests where needed --- python/pyphantomjs/plugincontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyphantomjs/plugincontroller.py b/python/pyphantomjs/plugincontroller.py index 3a7f1d44..4990a5f8 100644 --- a/python/pyphantomjs/plugincontroller.py +++ b/python/pyphantomjs/plugincontroller.py @@ -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