summaryrefslogtreecommitdiffstats
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-04 22:53:19 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-04 22:53:19 (GMT)
commit9252287f2c9bc09fdc6bc729e13ac63935e4976e (patch)
tree2593a9d4c32eff456f2229fcd5344e0ca85e6746 /Parser/tokenizer.c
parent1b933ed50aef2c31e003a001cef8647244ebfa0e (diff)
downloadcpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.zip
cpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.tar.gz
cpython-9252287f2c9bc09fdc6bc729e13ac63935e4976e.tar.bz2
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.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index a040696..18815ae 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;