summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-04 22:53:19 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-04 22:53:19 +0000
commit9e7ed39551fccad51e9bc928de303c6034de7a3a (patch)
treeb4409a65c2834aef3c9cfe716a3b6e3f9f06710b /Parser
parent13a59f9f2a0e9fdf59c50dd15becbeb82e76ff42 (diff)
downloadcpython-9e7ed39551fccad51e9bc928de303c6034de7a3a.tar.gz
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')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index a040696579..18815aef45 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;