tok->read_coding_spec = 0;
tok->issued_encoding_warning = 0;
tok->encoding = NULL;
+#ifndef PGEN
tok->decoding_readline = NULL;
tok->decoding_buffer = NULL;
+#endif
return tok;
}
char* r = new_string(begin, t - begin);
char* q = get_normal_name(r);
if (r != q) {
- assert(strlen(r) >= strlen(q));
- strcpy(r, q);
+ PyMem_DEL(r);
+ r = new_string(q, strlen(q));
}
return r;
}
{
if (tok->encoding != NULL)
PyMem_DEL(tok->encoding);
+#ifndef PGEN
Py_XDECREF(tok->decoding_readline);
Py_XDECREF(tok->decoding_buffer);
+#endif
if (tok->fp != NULL && tok->buf != NULL)
PyMem_DEL(tok->buf);
PyMem_DEL(tok);
int read_coding_spec; /* whether 'coding:...' has been read */
int issued_encoding_warning; /* whether non-ASCII warning was issued */
char *encoding;
+#ifndef PGEN
PyObject *decoding_readline; /* codecs.open(...).readline */
PyObject *decoding_buffer;
+#endif
const char* enc;
const char* str;
};