mirror of
https://github.com/python/cpython.git
synced 2026-05-18 10:24:42 -04:00
Merge 3.3.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user