10000 BUG: core: adjust ComplexWarning location frame up by one, so that th… · numpy/numpy@d24db34 · GitHub
[go: up one dir, main page]

Skip to content

Commit d24db34

Browse files
committed
BUG: core: adjust ComplexWarning location frame up by one, so that the warning comes from the correct location (#1639)
1 parent 658a1dc commit d24db34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

numpy/core/src/multiarray/convert_datatype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ PyArray_GetCastFunc(PyArray_Descr *descr, int type_num)
121121
#if PY_VERSION_HEX >= 0x02050000
122122
ret = PyErr_WarnEx(cls,
123123
"Casting complex values to real discards the imaginary "
124-
"part", 0);
124+
"part", 1);
125125
#else
126126
ret = PyErr_Warn(cls,
127127
"Casting complex values to real discards the imaginary "

numpy/core/src/scalarmathmodule.c.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ emit_complexwarning()
990990
#if PY_VERSION_HEX >= 0x02050000
991991
return PyErr_WarnEx(cls,
992992
"Casting complex values to real discards the imaginary "
993-
"part", 0);
993+
"part", 1);
994994
#else
995995
return PyErr_Warn(cls,
996996
"Casting complex values to real discards the imaginary "

0 commit comments

Comments
 (0)
0