diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-02 01:48:49 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-10-02 01:48:49 +0000 |
commit | 9b77c03453bdb9b3eb8cdfa1d2885653d56d770b (patch) | |
tree | 4678cb76865216f361034e502a5e911d4fc183f7 /Parser/parsetok.c | |
parent | e4f83c1d7c69e4141061aaf36063da0e229514ed (diff) | |
download | cpython-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.c | 2 |
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; } |