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-05-03 16:40:19 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-05-03 17:34:35 +0300
commit41b4a77dea51cf5eb16f9a3fdc27426827313d54 (patch)
treeaad1d45e1e780ef69a4872d1d4122d5292fc0755 /sphinx/pycode
parenta5cba8cdbb9f44721885c8555bf875df1f59e199 (diff)
Add stacklevel parameter to warnings.warn() call
Diffstat (limited to 'sphinx/pycode')
-rw-r--r--sphinx/pycode/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py
index 0a6ff5214..4879fb349 100644
--- a/sphinx/pycode/__init__.py
+++ b/sphinx/pycode/__init__.py
@@ -133,7 +133,7 @@ class ModuleAnalyzer:
pos = source.tell()
if not decoded:
warnings.warn('decode option for ModuleAnalyzer is deprecated.',
- RemovedInSphinx40Warning)
+ RemovedInSphinx40Warning, stacklevel=2)
self._encoding, _ = tokenize.detect_encoding(source.readline)
source.seek(pos)
self.code = source.read().decode(self._encoding)
@@ -185,5 +185,5 @@ class ModuleAnalyzer:
@property
def encoding(self) -> str:
warnings.warn('ModuleAnalyzer.encoding is deprecated.',
- RemovedInSphinx40Warning)
+ RemovedInSphinx40Warning, stacklevel=2)
return self._encoding