From b291d20b9fd42edbcaf37bbc4d30202d1eb48a6e Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Fri, 24 Jan 2020 14:15:10 +1300 Subject: MAINT/DOC: Remove use of old Python __builtin__, now known as builtins --- numpy/__init__.py | 7 ++----- numpy/core/defchararray.py | 2 +- numpy/distutils/misc_util.py | 1 - 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) -- cgit v1.2.1