[Python-checkins] cpython (merge 3.3 -> default): Merge 3.3.

stefan.krah python-checkins at python.org
Wed Nov 7 23:55:18 CET 2012


http://hg.python.org/cpython/rev/5fd9b87e08b3
changeset: 80296:5fd9b87e08b3
parent: 80294:57649a9a683c
parent: 80295:7fcc58811e82
user: Stefan Krah <skrah at bytereef.org>
date: Wed Nov 07 23:54:37 2012 +0100
summary:
 Merge 3.3.
files:
 Lib/test/test_decimal.py | 4 ++++
 Modules/_decimal/_decimal.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -2052,6 +2052,10 @@
 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
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -2345,7 +2345,7 @@
 PyObject *dec;
 uint32_t status = 0;
 
- if (type == &PyDec_Type) {
+ if (type == Py_TYPE(v)) {
 Py_INCREF(v);
 return v;
 }
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /