summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2010-10-16 11:36:44 +0200
committerPauli Virtanen <pav@iki.fi>2010-10-16 11:38:18 +0200
commitd24db3430a6710d18f9f9e77c89ee442e9c0d631 (patch)
treea04550b64ed4ca9e968c72e5d4c653e3f78cd720 /numpy/core
parent658a1dc843f26cd9f1815664d1634f3f0f9d8616 (diff)
downloadnumpy-d24db3430a6710d18f9f9e77c89ee442e9c0d631.tar.gz
BUG: core: adjust ComplexWarning location frame up by one, so that the warning comes from the correct location (#1639)
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c2
-rw-r--r--numpy/core/src/scalarmathmodule.c.src2
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 5cb62b82f..f93a45717 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -121,7 +121,7 @@ PyArray_GetCastFunc(PyArray_Descr *descr, int type_num)
#if PY_VERSION_HEX >= 0x02050000
ret = PyErr_WarnEx(cls,
"Casting complex values to real discards the imaginary "
- "part", 0);
+ "part", 1);
#else
ret = PyErr_Warn(cls,
"Casting complex values to real discards the imaginary "
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src
index 6261c4c73..6913f517d 100644
--- a/numpy/core/src/scalarmathmodule.c.src
+++ b/numpy/core/src/scalarmathmodule.c.src
@@ -990,7 +990,7 @@ emit_complexwarning()
#if PY_VERSION_HEX >= 0x02050000
return PyErr_WarnEx(cls,
"Casting complex values to real discards the imaginary "
- "part", 0);
+ "part", 1);
#else
return PyErr_Warn(cls,
"Casting complex values to real discards the imaginary "