summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorNathaniel Beaver <nathanielmbeaver@gmail.com>2015-09-10 03:47:44 -0500
committerNathaniel Beaver <nathanielmbeaver@gmail.com>2016-02-01 12:48:38 -0600
commit857c3a8ec160a618a54edd9407f77fbfc2a07678 (patch)
tree5b3e9520b7419a2ea5b9d4eb68e88bfe9e882b29 /numpy/core/numeric.py
parentd1dada15f60c3de9aa35eb58cc4ed41c3ebf21c4 (diff)
downloadnumpy-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.py2
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 = []