Issue #14701: Add missing support for 'raise ... from' in parser module.

This commit is contained in:
Mark Dickinson 2012-05-07 12:01:27 +01:00
parent 640335c61f
commit cf360b9209
3 changed files with 21 additions and 12 deletions

View file

@ -297,6 +297,14 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
self.check_suite("[*a, *b] = y")
self.check_suite("for [*x, b] in x: pass")
def test_raise_statement(self):
self.check_suite("raise\n")
self.check_suite("raise e\n")
self.check_suite("try:\n"
" suite\n"
"except Exception as e:\n"
" raise ValueError from e\n")
#
# Second, we take *invalid* trees and make sure we get ParserError