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 schluehk
Recipients schluehk
Date 2008-12-12.22:50:19
SpamBayes Score 1.230776e-10
Marked as misclassified No
Message-id <1229122221.79.0.426361145123.issue4647@psf.upfronthosting.co.za>
In-reply-to
Content
I've added the following test method:

test_parser.py 
--------------
class RoundtripLegalSyntaxTestCase(unittest.TestCase):

    def test_relative_import_statement(self):
        self.check_suite("from . import sys")

The test fails raising the message:

Traceback (most recent call last):
  File "test_parser.py", line 182, in test_relative_import_statement
    self.check_suite("from . import sys")
  File "test_parser.py", line 29, in check_suite
    self.roundtrip(parser.suite, s)
  File "test_parser.py", line 20, in roundtrip
    self.fail("could not roundtrip %r: %s" % (s, why))
AssertionError: could not roundtrip 'from . import sys': Expected node
type 1, got 23.


Apparently the parser expects a NAME token and gets a DOT token.

This behaviour affects Python 2.5 and Python 2.6. Unchecked for Python 3.0.
History
Date User Action Args
2008-12-12 22:50:21schluehksetrecipients: + schluehk
2008-12-12 22:50:21schluehksetmessageid: <1229122221.79.0.426361145123.issue4647@psf.upfronthosting.co.za>
2008-12-12 22:50:20schluehklinkissue4647 messages
2008-12-12 22:50:19schluehkcreate