summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
diff options
context:
space:
mode:
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);