summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mathmodule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 77e325c..2a73a98 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1106,9 +1106,13 @@ math_2(PyObject *const *args, Py_ssize_t nargs,
if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
return NULL;
x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
y = PyFloat_AsDouble(args[1]);
- if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
+ if (y == -1.0 && PyErr_Occurred()) {
return NULL;
+ }
errno = 0;
r = (*func)(x, y);
if (Py_IS_NAN(r)) {