summaryrefslogtreecommitdiffstats
path: root/Modules/datetimemodule.c
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-03 18:24:43 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-03 18:24:43 (GMT)
commita85998af7c44c047cb4e35cfa8373330e3f45088 (patch)
tree4f8af4d5cd63bb592f4504b729916a3cf8bb9285 /Modules/datetimemodule.c
parent999679a23ec5731d32dbdbf04b61d4ebb4bcd476 (diff)
downloadcpython-a85998af7c44c047cb4e35cfa8373330e3f45088.zip
cpython-a85998af7c44c047cb4e35cfa8373330e3f45088.tar.gz
cpython-a85998af7c44c047cb4e35cfa8373330e3f45088.tar.bz2
Issue #1950: Fixed misusage of PyUnicode_AsString().
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r--Modules/datetimemodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 711adba..e64b230 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -1217,10 +1217,9 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
assert(object && format && timetuple);
assert(PyUnicode_Check(format));
/* Convert the input format to a C string and size */
- pin = PyUnicode_AsString(format);
+ pin = PyUnicode_AsStringAndSize(format, &flen);
if (!pin)
return NULL;
- flen = PyUnicode_GetSize(format);
/* Give up if the year is before 1900.
* Python strftime() plays games with the year, and different