This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson
Date 2010-06-30.14:36:27
SpamBayes Score 7.1784867e-10
Marked as misclassified No
Message-id <1277908594.27.0.526273796473.issue9125@psf.upfronthosting.co.za>
In-reply-to
Content
There seems to be a parser module bug for the except-as syntax in Python 2.7.  After applying the attached patch (which adds a test to test_parser), and running test_parser, I get:


======================================================================
FAIL: test_try_stmt (__main__.RoundtripLegalSyntaxTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_parser.py", line 237, in test_try_stmt
    self.check_suite("try: pass\nexcept A as e: pass\n")
  File "Lib/test/test_parser.py", line 38, in check_suite
    self.roundtrip(parser.suite, s)
  File "Lib/test/test_parser.py", line 20, in roundtrip
    self.fail("could not roundtrip %r: %s" % (s, why))
AssertionError: could not roundtrip 'try: pass\nexcept A as e: pass\n': Expected node type 12, got 1.
History
Date User Action Args
2010-06-30 14:36:34mark.dickinsonsetrecipients: + mark.dickinson
2010-06-30 14:36:34mark.dickinsonsetmessageid: <1277908594.27.0.526273796473.issue9125@psf.upfronthosting.co.za>
2010-06-30 14:36:31mark.dickinsonlinkissue9125 messages
2010-06-30 14:36:31mark.dickinsoncreate