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 --- numpy/matrixlib/tests/test_defmatrix.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'numpy/matrixlib/tests') diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py index a8070898f..4cb5f3a37 100644 --- a/numpy/matrixlib/tests/test_defmatrix.py +++ b/numpy/matrixlib/tests/test_defmatrix.py @@ -1,9 +1,4 @@ -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 import numpy as np from numpy import matrix, asmatrix, bmat @@ -297,7 +292,7 @@ class TestMatrixReturn: if attrib.startswith('_') or attrib in excluded_methods: continue f = getattr(a, attrib) - if isinstance(f, collections_abc.Callable): + if isinstance(f, collections.abc.Callable): # reset contents of a a.astype('f8') a.fill(1.0) -- cgit v1.2.1