summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-11 19:55:01 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-11 19:55:01 (GMT)
commitbeac78bb242ba56088570d9df3a852f581adc0d5 (patch)
tree23482d5390130c302c2783344903218a1ab229aa /Modules
parente459a0877e0ca76e3af1057722a0e366395c661f (diff)
downloadcpython-beac78bb242ba56088570d9df3a852f581adc0d5.zip
cpython-beac78bb242ba56088570d9df3a852f581adc0d5.tar.gz
cpython-beac78bb242ba56088570d9df3a852f581adc0d5.tar.bz2
Use PyUnicode_AsUnicodeAndSize() instead of PyUnicode_GET_SIZE()
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 30760ed..da0bef0 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2529,10 +2529,9 @@ posix_listdir(PyObject *self, PyObject *args)
po_wchars = L".";
len = 1;
} else {
- po_wchars = PyUnicode_AsUnicode(po);
+ po_wchars = PyUnicode_AsUnicodeAndSize(po, &len);
if (po_wchars == NULL)
return NULL;
- len = PyUnicode_GET_SIZE(po);
}
/* Overallocate for \\*.*\0 */
wnamebuf = malloc((len + 5) * sizeof(wchar_t));