only clear the parser error if it's set (closes #12264)
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 020acd5..2b50fca 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -614,6 +614,13 @@
# XXX tests for pickling and unpickling of ST objects should go here
+class OtherParserCase(unittest.TestCase):
+
+ def test_two_args_to_expr(self):
+ # See bug #12264
+ with self.assertRaises(TypeError):
+ parser.expr("a", "b")
+
def test_main():
support.run_unittest(
@@ -622,6 +629,7 @@
CompileTestCase,
ParserStackLimitTestCase,
STObjectTestCase,
+ OtherParserCase,
)