diff options
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/tokenizer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 37e6c33..a79ea81 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -292,6 +292,12 @@ check_coding_spec(const char* line, int size, struct tok_state *tok, PyMem_DEL(cs); } } + if (!r) { + cs = tok->encoding; + if (!cs) + cs = "with BOM"; + PyErr_Format(PyExc_SyntaxError, "encoding problem: %s", cs); + } return r; } |