Remove unhandled_okay from kwargs if it's there before passing to functions.

This commit is contained in:
Christopher Allan Webber 2013-04-10 17:42:29 -05:00
parent cdc821eb74
commit 0a5c6ec901

View File

@ -307,13 +307,15 @@ def callable_runone(hookname, *args, **kwargs):
"""
callables = PluginManager().get_hook_callables(hookname)
unhandled_okay = kwargs.pop("unhandled_okay", False)
for callable in callables:
try:
return callable(*args, **kwargs)
except CantHandleIt:
continue
if kwargs.get("unhandled_okay", False) is False:
if unhandled_okay is False:
raise UnhandledCallable(
"No hooks registered capable of handling '%s'" % hookname)