From 0a5c6ec9011f678d9759183cb22e747d1084769f Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Apr 2013 17:42:29 -0500 Subject: [PATCH] Remove unhandled_okay from kwargs if it's there before passing to functions. --- mediagoblin/tools/pluginapi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mediagoblin/tools/pluginapi.py b/mediagoblin/tools/pluginapi.py index 2c0394aa..283350a8 100644 --- a/mediagoblin/tools/pluginapi.py +++ b/mediagoblin/tools/pluginapi.py @@ -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) -- 2.25.1