diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-04-25 15:22:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 15:22:58 -0600 |
commit | 651bb25d6b409b9031c40cf33f991d24f350edd3 (patch) | |
tree | c964055c79859d1cb901c42b42e1ae946af4699e /numpy/lib/histograms.py | |
parent | f80584a48ca9bcb2ff451a017bee2479ad78aa28 (diff) | |
parent | cadea53d822cf8e5c31ada659e49212bdceb3204 (diff) | |
download | numpy-651bb25d6b409b9031c40cf33f991d24f350edd3.tar.gz |
Merge pull request #16064 from keremh/fix-exception-raise
ENH: Fix exception causes in four .py files
Diffstat (limited to 'numpy/lib/histograms.py')
-rw-r--r-- | numpy/lib/histograms.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py index ede8a26e4..f080cc392 100644 --- a/numpy/lib/histograms.py +++ b/numpy/lib/histograms.py @@ -417,9 +417,9 @@ def _get_bin_edges(a, bins, range, weights): elif np.ndim(bins) == 0: try: n_equal_bins = operator.index(bins) - except TypeError: + except TypeError as e: raise TypeError( - '`bins` must be an integer, a string, or an array') + '`bins` must be an integer, a string, or an array') from e if n_equal_bins < 1: raise ValueError('`bins` must be positive, when an integer') |