diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-22 02:16:23 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-31 02:09:10 +0900 |
commit | 46c2e45aa69da739dee89a97c21f20253d1f61cc (patch) | |
tree | 37ab810926d93385e8d0c3c135b161b5d3099cb4 /sphinx/util/compat.py | |
parent | 5c275191b640481460f115c1a1dd40fcd88754e1 (diff) | |
download | sphinx-git-46c2e45aa69da739dee89a97c21f20253d1f61cc.tar.gz |
deprecate sphinx.ext.autosummary._app
Diffstat (limited to 'sphinx/util/compat.py')
-rw-r--r-- | sphinx/util/compat.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/util/compat.py b/sphinx/util/compat.py index 9be80358e..73ca5bc27 100644 --- a/sphinx/util/compat.py +++ b/sphinx/util/compat.py @@ -25,11 +25,14 @@ def register_application_for_autosummary(app: "Sphinx") -> None: """ if 'sphinx.ext.autosummary' in sys.modules: from sphinx.ext import autosummary - autosummary._app = app + if hasattr(autosummary, '_objects'): + autosummary._objects['_app'] = app # type: ignore + else: + autosummary._app = app # type: ignore def setup(app: "Sphinx") -> Dict[str, Any]: - app.connect('builder-inited', register_application_for_autosummary) + app.connect('builder-inited', register_application_for_autosummary, priority=100) return { 'version': 'builtin', |