Skip to content

Commit

Permalink
Merge pull request numpy#15418 from mwtoews/builtin
Browse files Browse the repository at this point in the history
MAINT, DOC: Remove use of old Python __builtin__, now known as builtins
  • Loading branch information
charris authored Jan 24, 2020
2 parents 5d9f15b + b291d20 commit b5fa352
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@
# 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
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/defchararray.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def str_len(a):
See also
--------
__builtin__.len
builtins.len
"""
return _vec_string(a, integer, '__len__')

Expand Down
1 change: 0 additions & 1 deletion numpy/distutils/misc_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b5fa352

Please sign in to comment.