From 9b77c03453bdb9b3eb8cdfa1d2885653d56d770b Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sun, 2 Oct 2005 01:48:49 +0000 Subject: - 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. --- Parser/parsetok.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Parser/parsetok.c') 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; } -- cgit v1.2.1