mirror of https://github.com/python/cpython.git
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:
parent
1b933ed50a
commit
9252287f2c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue