Make readthedocs build run without warnings

This commit is contained in:
Lonami Exo
2018-03-21 08:55:13 +01:00
parent 987cf41ec6
commit 89ae0cb164
3 changed files with 30 additions and 28 deletions

View File

@@ -1095,22 +1095,22 @@ class MessageDeleted(_EventBuilder):
class StopPropagation(Exception):
"""
If this Exception is found to be raised in any of the handlers for a
given update, it will stop the execution of all other registered
event handlers in the chain.
Think of it like a ``StopIteration`` exception in a for loop.
If this exception is raised in any of the handlers for a given event,
it will stop the execution of all other registered event handlers.
It can be seen as the ``StopIteration`` in a for loop but for events.
Example usage:
```
@client.on(events.NewMessage)
def delete(event):
event.delete()
# Other handlers won't have an event to work with
raise StopPropagation
@client.on(events.NewMessage)
def _(event):
# Will never be reached, because it is the second handler in the chain.
pass
```
>>> @client.on(events.NewMessage)
... def delete(event):
... event.delete()
... # No other event handler will have a chance to handle this event
... raise StopPropagation
...
>>> @client.on(events.NewMessage)
... def _(event):
... # Will never be reached, because it is the second handler
... pass
"""
# For some reason Sphinx wants the silly >>> or
# it will show warnings and look bad when generated.
pass