diff options
author | 2008-09-04 22:53:19 +0000 | |
---|---|---|
committer | 2008-09-04 22:53:19 +0000 | |
commit | 9252287f2c9bc09fdc6bc729e13ac63935e4976e (patch) | |
tree | 2593a9d4c32eff456f2229fcd5344e0ca85e6746 /Parser/tokenizer.c | |
parent | #3773: Check for errors around the use of PyTokenizer_FindEncoding(). (diff) | |
download | cpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.tar.gz cpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.tar.bz2 cpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.zip |
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.
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index a0406965790..18815aef452 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -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; |