diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-11-10 22:09:04 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-11-10 22:09:04 (GMT) |
commit | 6e467049c68632dd58502a42b367100e99edb66b (patch) | |
tree | cce6a9d8eb315883c74671effbe7b8de6c59425a /Modules/_decimal | |
parent | 6b0bdab4293684a2a7e47e8e8e70076c8670eb9b (diff) | |
download | cpython-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.c | 4 |
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); |