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/core/memmap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/memmap.py') diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index ad0d7ad79..61b8ba3ac 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -1,7 +1,7 @@ import numpy as np from .numeric import uint8, ndarray, dtype from numpy.compat import ( - long, basestring, os_fspath, contextlib_nullcontext, is_pathlib_path + long, os_fspath, contextlib_nullcontext, is_pathlib_path ) from numpy.core.overrides import set_module @@ -271,7 +271,7 @@ class memmap(ndarray): # special case - if we were constructed with a pathlib.path, # then filename is a path object, not a string self.filename = filename.resolve() - elif hasattr(fid, "name") and isinstance(fid.name, basestring): + elif hasattr(fid, "name") and isinstance(fid.name, str): # py3 returns int for TemporaryFile().name self.filename = os.path.abspath(fid.name) # same as memmap copies (e.g. memmap + 1) -- cgit v1.2.1