diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-01-25 23:21:33 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-01-25 23:21:33 +0900 |
commit | 045630ec85b8d617cd0a7f8b2f96379e68d3840c (patch) | |
tree | 6840ceac6fc5f8ac2c670fff73b9143b41d2a4cf /sphinx/util/inspect.py | |
parent | ecf38edb439cb8dc76d3a31adc5e358c8c859f97 (diff) | |
download | sphinx-git-045630ec85b8d617cd0a7f8b2f96379e68d3840c.tar.gz |
Deprecate sphinx.util.inspect:safe_getmembers()
Diffstat (limited to 'sphinx/util/inspect.py')
-rw-r--r-- | sphinx/util/inspect.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index ab3038b05..41d60aebb 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -257,6 +257,8 @@ def safe_getattr(obj: Any, name: str, *defargs: Any) -> Any: def safe_getmembers(object: Any, predicate: Callable[[str], bool] = None, attr_getter: Callable = safe_getattr) -> List[Tuple[str, Any]]: """A version of inspect.getmembers() that uses safe_getattr().""" + warnings.warn('safe_getmembers() is deprecated', RemovedInSphinx40Warning) + results = [] # type: List[Tuple[str, Any]] for key in dir(object): try: |