summaryrefslogtreecommitdiffstats
path: root/Modules/_datetimemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_datetimemodule.c')
-rw-r--r--Modules/_datetimemodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 32fe835..16964d8 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1257,7 +1257,8 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
assert(PyUnicode_Check(Zreplacement));
ptoappend = _PyUnicode_AsStringAndSize(Zreplacement,
&ntoappend);
- ntoappend = Py_SIZE(Zreplacement);
+ if (ptoappend == NULL)
+ goto Done;
}
else if (ch == 'f') {
/* format microseconds */