]> granicus.if.org Git - python/commitdiff
Issue #27006: Do not use PyDec_CheckExact() on a type.
authorStefan Krah <skrah@bytereef.org>
Mon, 20 Jun 2016 12:12:52 +0000 (14:12 +0200)
committerStefan Krah <skrah@bytereef.org>
Mon, 20 Jun 2016 12:12:52 +0000 (14:12 +0200)
Modules/_decimal/_decimal.c

index e69d715bb214975602751275b0a064bbf3e65fbc..22053b4924896f5df9785869727ba93a233187e0 100644 (file)
@@ -2637,7 +2637,7 @@ dec_from_float(PyObject *type, PyObject *pyfloat)
 
     CURRENT_CONTEXT(context);
     result = PyDecType_FromFloatExact(&PyDec_Type, pyfloat, context);
-    if (!PyDec_CheckExact(type) && result != NULL) {
+    if (type != (PyObject *)&PyDec_Type && result != NULL) {
         Py_SETREF(result, PyObject_CallFunctionObjArgs(type, result, NULL));
     }