summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2020-01-24 14:15:10 +1300
committerMike Taves <mwtoews@gmail.com>2020-01-24 14:15:10 +1300
commitb291d20b9fd42edbcaf37bbc4d30202d1eb48a6e (patch)
tree42e640c4f89eb84e0363b477392c325b6e9dd977
parent68224f43d09393c1981bb83ee3c13a5158d2817c (diff)
downloadnumpy-b291d20b9fd42edbcaf37bbc4d30202d1eb48a6e.tar.gz
MAINT/DOC: Remove use of old Python __builtin__, now known as builtins
-rw-r--r--numpy/__init__.py7
-rw-r--r--numpy/core/defchararray.py2
-rw-r--r--numpy/distutils/misc_util.py1
3 files changed, 3 insertions, 7 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index 73e979a18..00c4a3d78 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -157,11 +157,8 @@ else:
# Make these accessible from numpy name-space
# but not imported in from numpy import *
# TODO[gh-6103]: Deprecate these
- if sys.version_info[0] >= 3:
- from builtins import bool, int, float, complex, object, str
- unicode = str
- else:
- from __builtin__ import bool, int, float, complex, object, unicode, str
+ from builtins import bool, int, float, complex, object, str
+ unicode = str
from .core import round, abs, max, min
# now that numpy modules are imported, can initialize limits
diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py
index bc101f84b..942a698a9 100644
--- a/numpy/core/defchararray.py
+++ b/numpy/core/defchararray.py
@@ -274,7 +274,7 @@ def str_len(a):
See also
--------
- __builtin__.len
+ builtins.len
"""
return _vec_string(a, integer, '__len__')
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
index b7fd74c47..4be1df94e 100644
--- a/numpy/distutils/misc_util.py
+++ b/numpy/distutils/misc_util.py
@@ -164,7 +164,6 @@ def get_path_from_frame(frame, parent_path=None):
# we're probably running setup.py as execfile("setup.py")
# (likely we're building an egg)
d = os.path.abspath('.')
- # hmm, should we use sys.argv[0] like in __builtin__ case?
if parent_path is not None:
d = rel_path(d, parent_path)