summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-06-05 03:06:42 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-06-05 03:06:42 (GMT)
commitf719957d7a1f8ee1545e7b5bd3f59aa24e6db5fc (patch)
treefa3d4773a7bd2a4883a5e7f2ed61b9218fd8fe2a /Modules
parent4dfcb1a00dbcbc76fcd152d652d3f83b53b14e45 (diff)
downloadcpython-f719957d7a1f8ee1545e7b5bd3f59aa24e6db5fc.zip
cpython-f719957d7a1f8ee1545e7b5bd3f59aa24e6db5fc.tar.gz
cpython-f719957d7a1f8ee1545e7b5bd3f59aa24e6db5fc.tar.bz2
only clear the parser error if it's set (closes #12264)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/parsermodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index e5b4e55..1ffa896 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -581,10 +581,11 @@ parser_do_parse(PyObject *args, PyObject *kw, char *argspec, int type)
if (res)
((PyST_Object *)res)->st_flags.cf_flags = flags & PyCF_MASK;
}
- else
+ else {
PyParser_SetError(&err);
+ PyParser_ClearError(&err);
+ }
}
- PyParser_ClearError(&err);
return (res);
}