Commit 9252287f authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Follow-up of #3773: In PyTokenizer_FindEncoding, remove the call to...

Follow-up of #3773: In PyTokenizer_FindEncoding, remove the call to PyErr_NoMemory when PyMem_MALLOC() fails.
It is not stritly necessary, the function may already return NULL without an exception set,
for example when the file cannot be opened.

Discussed with Benjamin Peterson.
parent 1b933ed5
......@@ -1612,8 +1612,6 @@ PyTokenizer_FindEncoding(int fd)
encoding = (char *)PyMem_MALLOC(strlen(tok->encoding) + 1);
if (encoding)
strcpy(encoding, tok->encoding);
else
PyErr_NoMemory();
}
PyTokenizer_Free(tok);
return encoding;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment