Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-07 14:43:25 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-04-29 09:12:39 +0300
commita86346aca6bf99a8920da366caaad7c47809ecce (patch)
tree7aa786e7817f9f3e6a338d06df2f02534d91a4c5 /sphinx/events.py
parentaa773cbc88e692df731c78353a1043201bcb9f91 (diff)
Remove deprecated features marked as RemovedInSphinx40Warning
Diffstat (limited to 'sphinx/events.py')
-rw-r--r--sphinx/events.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/sphinx/events.py b/sphinx/events.py
index 46759eccd..4673fddd8 100644
--- a/sphinx/events.py
+++ b/sphinx/events.py
@@ -10,13 +10,11 @@
:license: BSD, see LICENSE for details.
"""
-import warnings
from collections import defaultdict
from operator import attrgetter
from typing import Any, Callable, Dict, List, NamedTuple
from typing import TYPE_CHECKING
-from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.errors import ExtensionError
from sphinx.locale import __
from sphinx.util import logging
@@ -56,10 +54,7 @@ core_events = {
class EventManager:
"""Event manager for Sphinx."""
- def __init__(self, app: "Sphinx" = None) -> None:
- if app is None:
- warnings.warn('app argument is required for EventManager.',
- RemovedInSphinx40Warning)
+ def __init__(self, app: "Sphinx") -> None:
self.app = app
self.events = core_events.copy()
self.listeners = defaultdict(list) # type: Dict[str, List[EventListener]]
@@ -100,11 +95,7 @@ class EventManager:
results = []
listeners = sorted(self.listeners[name], key=attrgetter("priority"))
for listener in listeners:
- if self.app is None:
- # for compatibility; RemovedInSphinx40Warning
- results.append(listener.handler(*args))
- else:
- results.append(listener.handler(self.app, *args))
+ results.append(listener.handler(self.app, *args))
return results
def emit_firstresult(self, name: str, *args: Any) -> Any: