diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-03 16:40:19 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-03 17:34:35 +0300 |
commit | 41b4a77dea51cf5eb16f9a3fdc27426827313d54 (patch) | |
tree | aad1d45e1e780ef69a4872d1d4122d5292fc0755 /sphinx/environment | |
parent | a5cba8cdbb9f44721885c8555bf875df1f59e199 (diff) |
Add stacklevel parameter to warnings.warn() call
Diffstat (limited to 'sphinx/environment')
-rw-r--r-- | sphinx/environment/__init__.py | 4 | ||||
-rw-r--r-- | sphinx/environment/collectors/indexentries.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index c8735461d..6584ac6d8 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -331,10 +331,10 @@ class BuildEnvironment: """ if suffix: warnings.warn('The suffix argument for doc2path() is deprecated.', - RemovedInSphinx40Warning) + RemovedInSphinx40Warning, stacklevel=2) if base not in (True, False, None): warnings.warn('The string style base argument for doc2path() is deprecated.', - RemovedInSphinx40Warning) + RemovedInSphinx40Warning, stacklevel=2) pathname = self.project.doc2path(docname, base is True) if suffix: diff --git a/sphinx/environment/collectors/indexentries.py b/sphinx/environment/collectors/indexentries.py index 2ef59909b..a4c0450d2 100644 --- a/sphinx/environment/collectors/indexentries.py +++ b/sphinx/environment/collectors/indexentries.py @@ -29,7 +29,7 @@ class IndexEntriesCollector(EnvironmentCollector): def __init__(self) -> None: warnings.warn('IndexEntriesCollector is deprecated.', - RemovedInSphinx40Warning) + RemovedInSphinx40Warning, stacklevel=2) def clear_doc(self, app: Sphinx, env: BuildEnvironment, docname: str) -> None: env.indexentries.pop(docname, None) |