summaryrefslogtreecommitdiff
path: root/Parser/parsetok.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-10-02 01:48:49 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2005-10-02 01:48:49 +0000
commit9b77c03453bdb9b3eb8cdfa1d2885653d56d770b (patch)
tree4678cb76865216f361034e502a5e911d4fc183f7 /Parser/parsetok.c
parente4f83c1d7c69e4141061aaf36063da0e229514ed (diff)
downloadcpython-9b77c03453bdb9b3eb8cdfa1d2885653d56d770b.tar.gz
- Fix segfault with invalid coding.
- SF Bug #772896, unknown encoding results in MemoryError, which is not helpful I will only backport the segfault fix. I'll let Anthony decide if he wants the other changes backported. I will do the backport if asked.
Diffstat (limited to 'Parser/parsetok.c')
-rw-r--r--Parser/parsetok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 1fa9739308..1d25437f4c 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -42,7 +42,7 @@ PyParser_ParseStringFlagsFilename(const char *s, const char *filename,
initerr(err_ret, filename);
if ((tok = PyTokenizer_FromString(s)) == NULL) {
- err_ret->error = E_NOMEM;
+ err_ret->error = PyErr_Occurred() ? E_DECODE : E_NOMEM;
return NULL;
}