Merge 3.3.

This commit is contained in:
Stefan Krah 2012-11-07 23:54:37 +01:00
commit d2d3aa2038
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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;
}