mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #14701: Add missing support for 'raise ... from' in parser module.
This commit is contained in:
parent
640335c61f
commit
cf360b9209
3 changed files with 21 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue