From 1bc1fd6bc2ec9c68997736cec1ce5dd4a625ea2f Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Wed, 22 Jan 2020 20:59:58 +1300 Subject: MAINT: Revise imports from collections.abc module --- doc/summarize.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'doc/summarize.py') 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: -- cgit v1.2.1