From b4e3a4227e3a9cfe28717db458e67d79e916a418 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Thu, 23 Jan 2020 14:44:36 -0700 Subject: MAINT: Replace basestring with str. This replaces basestring with str except in - tools/npy_tempita/ - numpy/compat/py3k.py --- numpy/lib/_version.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'numpy/lib/_version.py') diff --git a/numpy/lib/_version.py b/numpy/lib/_version.py index 6a7c5cba1..d4098acb5 100644 --- a/numpy/lib/_version.py +++ b/numpy/lib/_version.py @@ -7,8 +7,6 @@ work; they don't recognize anything like alpha/beta/rc/dev versions. """ import re -from numpy.compat import basestring - __all__ = ['NumpyVersion'] @@ -114,10 +112,10 @@ class NumpyVersion(): return vercmp def _compare(self, other): - if not isinstance(other, (basestring, NumpyVersion)): + if not isinstance(other, (str, NumpyVersion)): raise ValueError("Invalid object to compare with NumpyVersion.") - if isinstance(other, basestring): + if isinstance(other, str): other = NumpyVersion(other) vercmp = self._compare_version(other) -- cgit v1.2.1