diff options
| -rw-r--r-- | doc/ext/appapi.rst | 3 | ||||
| -rw-r--r-- | sphinx/application.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/doc/ext/appapi.rst b/doc/ext/appapi.rst index f3a4a061..77ced4ef 100644 --- a/doc/ext/appapi.rst +++ b/doc/ext/appapi.rst @@ -269,8 +269,7 @@ the following public API: .. method:: Sphinx.emit_firstresult(event, *arguments) Emit *event* and pass *arguments* to the callback functions. Return the - result of the first callback that doesn't return ``None`` (and don't call - the rest of the callbacks). + result of the first callback that doesn't return ``None``. .. versionadded:: 0.5 diff --git a/sphinx/application.py b/sphinx/application.py index 61c3b05a..758dd6ad 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -274,11 +274,11 @@ class Sphinx(object): event.pop(listener_id, None) def emit(self, event, *args): - result = [] + results = [] if event in self._listeners: for _, callback in self._listeners[event].iteritems(): - result.append(callback(self, *args)) - return result + results.append(callback(self, *args)) + return results def emit_firstresult(self, event, *args): for result in self.emit(event, *args): |
