Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
def test_invisible_characters(self):
self._check_error('print\x17("Hello")', "invalid non-printable character")
+ self._check_error(b"with(0,,):\n\x01", "invalid non-printable character")
def test_match_call_does_not_raise_syntax_error(self):
code = """
--- /dev/null
+Fix an error that was causing the parser to try to overwrite tokenizer
+errors. Patch by pablo Galindo
void *
_PyPegen_raise_error(Parser *p, PyObject *errtype, int use_mark, const char *errmsg, ...)
{
+ // Bail out if we already have an error set.
+ if (p->error_indicator && PyErr_Occurred()) {
+ return NULL;
+ }
if (p->fill == 0) {
va_list va;
va_start(va, errmsg);