summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorjutke <jutke@allstate.com>2017-01-17 12:33:34 -0600
committerjutke <jutke@allstate.com>2017-01-20 09:31:03 -0600
commit892c54cda15163552fa2245b476aa765f2aa2061 (patch)
tree3c9e935e69e8956e49ffce2cc1587e4304b2c994 /numpy/core/fromnumeric.py
parent6f378b36f16d1667704234a2f6287588a04e210b (diff)
downloadnumpy-892c54cda15163552fa2245b476aa765f2aa2061.tar.gz
BUG: guard against replacing constants without '_' spec
fixes #8493 In the reported problem snippet the attempt to infer the type of parameter (wasize=maxiterates*2) leads to a lookup of maxiterates in the logic of get_parameters which finds and correctly assigns to 'v' the value string '50000' However, then in the logic proceds to attempt to split off any underscore-appended precision spec from v_ which yields ['50000'] because there is no underscore. Finally line v = ''.join(v_[:-1]).lower().replace(v_[-1].lower(), '') if not quarded by the newly introduced lengthtest sets v to empty because [:-1] of a list with one element yields an empty list. Subsequently the type inference by running eval on an empty string fails with the error message quoted. The introduced length check appears to correct this problem.
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions