aboutsummaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 15e8185f8f6..cc142a71272 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -682,11 +682,8 @@ decode_str(const char *str, struct tok_state *tok)
if (tok->enc != NULL) {
assert(utf8 == NULL);
utf8 = translate_into_utf8(str, tok->enc);
- if (utf8 == NULL) {
- PyErr_Format(PyExc_SyntaxError,
- "unknown encoding: %s", tok->enc);
+ if (utf8 == NULL)
return error_ret(tok);
- }
str = PyBytes_AS_STRING(utf8);
}
assert(tok->decoding_buffer == NULL);