diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-03 22:40:19 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-03 23:34:35 +0900 |
commit | 41b4a77dea51cf5eb16f9a3fdc27426827313d54 (patch) | |
tree | aad1d45e1e780ef69a4872d1d4122d5292fc0755 /sphinx/util/docfields.py | |
parent | a5cba8cdbb9f44721885c8555bf875df1f59e199 (diff) | |
download | sphinx-git-41b4a77dea51cf5eb16f9a3fdc27426827313d54.tar.gz |
Add stacklevel parameter to warnings.warn() call
Diffstat (limited to 'sphinx/util/docfields.py')
-rw-r--r-- | sphinx/util/docfields.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index 699738888..c07bc7f66 100644 --- a/sphinx/util/docfields.py +++ b/sphinx/util/docfields.py @@ -224,12 +224,12 @@ class DocFieldTransformer: except Exception: # for 3rd party extensions directly calls this transformer. warnings.warn('DocFieldTransformer expects given directive object is a subclass ' - 'of ObjectDescription.', RemovedInSphinx40Warning) + 'of ObjectDescription.', RemovedInSphinx40Warning, stacklevel=2) self.typemap = self.preprocess_fieldtypes(directive.__class__.doc_field_types) def preprocess_fieldtypes(self, types: List[Field]) -> Dict[str, Tuple[Field, bool]]: warnings.warn('DocFieldTransformer.preprocess_fieldtypes() is deprecated.', - RemovedInSphinx40Warning) + RemovedInSphinx40Warning, stacklevel=2) typemap = {} for fieldtype in types: for name in fieldtype.names: |