diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-04-10 17:42:29 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-04-10 17:42:29 -0500 |
commit | 0a5c6ec9011f678d9759183cb22e747d1084769f (patch) | |
tree | 8b6a189e5fa520c230dae16affbde3400649d5b1 /mediagoblin/tools/pluginapi.py | |
parent | cdc821eb743729fe81dea573ef71091b777301c3 (diff) | |
download | mediagoblin-0a5c6ec9011f678d9759183cb22e747d1084769f.tar.lz mediagoblin-0a5c6ec9011f678d9759183cb22e747d1084769f.tar.xz mediagoblin-0a5c6ec9011f678d9759183cb22e747d1084769f.zip |
Remove unhandled_okay from kwargs if it's there before passing to functions.
Diffstat (limited to 'mediagoblin/tools/pluginapi.py')
-rw-r--r-- | mediagoblin/tools/pluginapi.py | 4 |
1 files changed, 3 insertions, 1 deletions
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) |