Merge 3.3.
This commit is contained in:
commit
d2d3aa2038
|
@ -2052,6 +2052,10 @@ class UsabilityTest(unittest.TestCase):
|
|||
self.assertIs(type(b), MyDecimal)
|
||||
self.assertEqual(a, b)
|
||||
|
||||
c = Decimal(b)
|
||||
self.assertIs(type(c), Decimal)
|
||||
self.assertEqual(a, c)
|
||||
|
||||
def test_implicit_context(self):
|
||||
Decimal = self.decimal.Decimal
|
||||
getcontext = self.decimal.getcontext
|
||||
|
|
|
@ -2345,7 +2345,7 @@ PyDecType_FromDecimalExact(PyTypeObject *type, PyObject *v, PyObject *context)
|
|||
PyObject *dec;
|
||||
uint32_t status = 0;
|
||||
|
||||
if (type == &PyDec_Type) {
|
||||
if (type == Py_TYPE(v)) {
|
||||
Py_INCREF(v);
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue