[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Kay Schluehr

New submission from Kay Schluehr k...@fiber-space.de:

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.

--
components: Interpreter Core
messages: 77690
nosy: schluehk
severity: normal
status: open
title: Builtin parser module fails to parse relative imports
type: behavior
versions: Python 2.5, Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4647
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4647] Builtin parser module fails to parse relative imports

2008-12-12 Thread Benjamin Peterson

Benjamin Peterson musiccomposit...@gmail.com added the comment:

This has been fixed in 2.6.1 and will be in 2.5.3.

--
nosy: +benjamin.peterson
resolution:  - out of date
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4647
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com