8000 1.7.x backport by certik · Pull Request #472 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

1.7.x backport #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 1, 2012
Prev Previous commit
Next Next commit
BUG: change FutureWarning to DeprecationWarning
Use of PyErr_WarnEx causing failure for Python 2.4.
  • Loading branch information
matthew-brett authored and certik committed Oct 1, 2012
commit 91fb6e4f01ffe25671de168ca6d9f6ea19c1a237
8 changes: 5 additions & 3 deletions numpy/core/src/multiarray/multiarraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@ PyArray_ConcatenateArrays(int narrays, PyArrayObject **arrays, int axis)
}

if (ndim == 1 & axis != 0) {
PyErr_WarnEx(PyExc_FutureWarning,
"axis not 0 for ndim == 0; this will raise an error "
"in future versions of numpy", 2);
char msg[] = "axis != 0 for ndim == 1; this will raise an error in "
"future versions of numpy";
if (DEPRECATE(msg) < 0) {
return NULL;
}
axis = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion numpy/core/tests/test_shape_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_concatenate_sloppy0():
r4 = list(range(4))
r3 = list(range(3))
assert_array_equal(concatenate((r4, r3), 0), r4 + r3)
warnings.simplefilter('ignore', FutureWarning)
warnings.simplefilter('ignore', DeprecationWarning)
try:
assert_array_equal(concatenate((r4, r3), -10), r4 + r3)
assert_array_equal(concatenate((r4, r3), 10), r4 + r3)
Expand Down
0