]> granicus.if.org Git - python/commitdiff
make sure expected values are interpreted as doubles
authorBenjamin Peterson <benjamin@python.org>
Thu, 8 Sep 2016 01:09:22 +0000 (18:09 -0700)
committerBenjamin Peterson <benjamin@python.org>
Thu, 8 Sep 2016 01:09:22 +0000 (18:09 -0700)
Modules/_testcapimodule.c

index 87cf4b271a6fd3ab7191fc73dd93182b6b3311df..7d7fa40be25f6af27871718df03ceec71f6d0903 100644 (file)
@@ -2309,7 +2309,7 @@ test_string_to_double(PyObject *self) {
     result = PyOS_string_to_double(STR, NULL, NULL);            \
     if (result == -1.0 && PyErr_Occurred())                     \
         return NULL;                                            \
-    if (result != expected) {                                   \
+    if (result != (double)expected) {                           \
         msg = "conversion of " STR " to float failed";          \
         goto fail;                                              \
     }