diff options
author | Mike Taves <mwtoews@gmail.com> | 2020-01-22 20:59:58 +1300 |
---|---|---|
committer | Mike Taves <mwtoews@gmail.com> | 2020-01-22 22:04:18 +1300 |
commit | 1bc1fd6bc2ec9c68997736cec1ce5dd4a625ea2f (patch) | |
tree | a6d8caad7d2e691ac44966f61adc174d768f14ee /doc | |
parent | e94cec800304a6a467cf90ce4e7d3e207770b4b4 (diff) | |
download | numpy-1bc1fd6bc2ec9c68997736cec1ce5dd4a625ea2f.tar.gz |
MAINT: Revise imports from collections.abc module
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/summarize.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/doc/summarize.py b/doc/summarize.py index 9b02a408c..ea2397538 100755 --- a/doc/summarize.py +++ b/doc/summarize.py @@ -6,12 +6,8 @@ Show a summary about which NumPy functions are documented and which are not. """ import os, glob, re, sys, inspect, optparse -try: - # Accessing collections abstract classes from collections - # has been deprecated since Python 3.3 - import collections.abc as collections_abc -except ImportError: - import collections as collections_abc +import collections.abc + sys.path.append(os.path.join(os.path.dirname(__file__), 'sphinxext')) from sphinxext.phantom_import import import_phantom_module @@ -139,7 +135,9 @@ def get_undocumented(documented, module, module_name=None, skip=[]): if full_name in skip: continue if full_name.startswith('numpy.') and full_name[6:] in skip: continue - if not (inspect.ismodule(obj) or isinstance(obj, collections_abc.Callable) or inspect.isclass(obj)): + if not (inspect.ismodule(obj) or + isinstance(obj, collections.abc.Callable) or + inspect.isclass(obj)): continue if full_name not in documented: |