#773 "from ...foo import bar" results in an error

1.3.19
closed-fixed
nobody
None
5
2008-09-20
2008-08-19
Volodya Orlenko
No

Using absolute_import (Python 2.5) and a structure like one shown below, I get an error from PyDev when trying to import a module from two levels up ("from ...two import module2").

The module causing the error:

from __future__ import absolute_import

from ...two import module2

The error message:

Encountered "two" at line 7, column 9. Was expecting one of: "." ... "import"

Directory structure:

one/
__init__.py
two/
__init__.py
module2.py
three/
__init__.py
module3.py

Python 2.5 handles this code correctly, so expected behavior for PyDev is not to show an error in this case.

Discussion

  • Fabio Zadrozny
    Fabio Zadrozny
    2008-09-19

    Just to give some feedback, it's an error in the grammar (currently it's giving an error when more than 2 dots are found). I'm working on it now.

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2008-09-20

    • status: open --> closed-fixed
     
  • Fabio Zadrozny
    Fabio Zadrozny
    2008-09-20

    Fixed for 1.3.21