Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0519ea3

Browse files
committed
Don't index into __builtins__ (not supported by PyPy).
1 parent 9d802a9 commit 0519ea3

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6147,12 +6147,9 @@ def _normalize_input(inp, ename='input'):
61476147
if bins is None:
61486148
bins = rcParams['hist.bins']
61496149

6150-
# xrange becomes range after 2to3
6150+
# Avoid shadowing the builtin.
61516151
bin_range = range
6152-
range = __builtins__["range"]
6153-
6154-
# NOTE: the range keyword overwrites the built-in func range !!!
6155-
# needs to be fixed in numpy !!!
6152+
del range
61566153

61576154
# Validate string inputs here so we don't have to clutter
61586155
# subsequent code.
@@ -6514,10 +6511,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65146511
.. plot:: mpl_examples/statistics/plot_hist.py
65156512
"""
65166513

6517-
# xrange becomes range after 2to3
6518-
bin_range = range
6519-
range = __builtins__["range"]
6520-
h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=bin_range,
6514+
h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=range,
65216515
normed=normed, weights=weights)
65226516

65236517
if cmin is not None:

0 commit comments

Comments
 (0)