diff options
author | Nathaniel Beaver <nathanielmbeaver@gmail.com> | 2015-09-10 03:47:44 -0500 |
---|---|---|
committer | Nathaniel Beaver <nathanielmbeaver@gmail.com> | 2016-02-01 12:48:38 -0600 |
commit | 857c3a8ec160a618a54edd9407f77fbfc2a07678 (patch) | |
tree | 5b3e9520b7419a2ea5b9d4eb68e88bfe9e882b29 /numpy/core/numeric.py | |
parent | d1dada15f60c3de9aa35eb58cc4ed41c3ebf21c4 (diff) | |
download | numpy-857c3a8ec160a618a54edd9407f77fbfc2a07678.tar.gz |
BUG: check lower limit of base in base_repr.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 0b728f804..756c426f7 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2232,6 +2232,8 @@ def base_repr(number, base=2, padding=0): digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' if base > len(digits): raise ValueError("Bases greater than 36 not handled in base_repr.") + elif base < 2: + raise ValueError("Bases less than 2 not handled in base_repr.") num = abs(number) res = [] |