mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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
1 changed files with 0 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue