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.
This commit is contained in:
Amaury Forgeot d'Arc 2008-09-04 22:53:19 +00:00
parent 1b933ed50a
commit 9252287f2c
1 changed files with 0 additions and 2 deletions

View File

@ -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;