summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-11-10 22:09:04 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-11-10 22:09:04 (GMT)
commit6e467049c68632dd58502a42b367100e99edb66b (patch)
treecce6a9d8eb315883c74671effbe7b8de6c59425a /Modules/_decimal
parent6b0bdab4293684a2a7e47e8e8e70076c8670eb9b (diff)
downloadcpython-6e467049c68632dd58502a42b367100e99edb66b.zip
cpython-6e467049c68632dd58502a42b367100e99edb66b.tar.gz
cpython-6e467049c68632dd58502a42b367100e99edb66b.tar.bz2
Accept Unicode legacy strings in the Decimal constructor.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/_decimal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index e951ded..0610a8b 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -1892,7 +1892,9 @@ numeric_as_ascii(const PyObject *u, int strip_ws)
Py_ssize_t j, len;
int d;
- assert(PyUnicode_IS_READY(u));
+ if (PyUnicode_READY(u) == -1) {
+ return NULL;
+ }
kind = PyUnicode_KIND(u);
data = PyUnicode_DATA(u);