summaryrefslogtreecommitdiffstats
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 8f30fef..6320f75 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -383,7 +383,8 @@ fp_readl(char *s, int size, struct tok_state *tok)
goto error;
allocated = 1;
}
- if (PyObject_AsCharBuffer(bufobj, &buf, &buflen) < 0) {
+ buf = PyUnicode_AsStringAndSize(bufobj, &buflen);
+ if (buf == NULL) {
goto error;
}
if (buflen > size) {