diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-11-08 10:17:29 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-11-08 10:17:29 (GMT) |
commit | 0f82b76b574724618f7de929c0f30aecc58c3bf7 (patch) | |
tree | 216c9b54663d9684657bba8503422071278fdf0d /Modules/_decimal | |
parent | 9cfa1ff891af6394cfcd4373c0c7d1e2a2dfd371 (diff) | |
download | cpython-0f82b76b574724618f7de929c0f30aecc58c3bf7.zip cpython-0f82b76b574724618f7de929c0f30aecc58c3bf7.tar.gz cpython-0f82b76b574724618f7de929c0f30aecc58c3bf7.tar.bz2 |
Issue #16431: Finally, consider all permutations.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/_decimal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 0e1d304..e951ded 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -2338,14 +2338,14 @@ PyDecType_FromFloat(PyTypeObject *type, PyObject *v, return dec; } -/* Return a new PyDecObject (subtype) from a Decimal. */ +/* Return a new PyDecObject or a subtype from a Decimal. */ static PyObject * PyDecType_FromDecimalExact(PyTypeObject *type, PyObject *v, PyObject *context) { PyObject *dec; uint32_t status = 0; - if (type == Py_TYPE(v)) { + if (type == &PyDec_Type && PyDec_CheckExact(v)) { Py_INCREF(v); return v; } |