mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Ignore warnings for numpydocs
This commit is contained in:
@@ -16,6 +16,7 @@ annotations.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import warnings
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from parso import parse, ParserSyntaxError
|
from parso import parse, ParserSyntaxError
|
||||||
@@ -60,6 +61,8 @@ def _get_numpy_doc_string_cls():
|
|||||||
|
|
||||||
def _search_param_in_numpydocstr(docstr, param_str):
|
def _search_param_in_numpydocstr(docstr, param_str):
|
||||||
"""Search `docstr` (in numpydoc format) for type(-s) of `param_str`."""
|
"""Search `docstr` (in numpydoc format) for type(-s) of `param_str`."""
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
try:
|
try:
|
||||||
# This is a non-public API. If it ever changes we should be
|
# This is a non-public API. If it ever changes we should be
|
||||||
# prepared and return gracefully.
|
# prepared and return gracefully.
|
||||||
@@ -79,6 +82,8 @@ def _search_return_in_numpydocstr(docstr):
|
|||||||
"""
|
"""
|
||||||
Search `docstr` (in numpydoc format) for type(-s) of function returns.
|
Search `docstr` (in numpydoc format) for type(-s) of function returns.
|
||||||
"""
|
"""
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
try:
|
try:
|
||||||
doc = _get_numpy_doc_string_cls()(docstr)
|
doc = _get_numpy_doc_string_cls()(docstr)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user