logilab-astng #53142 fix relative and absolute import [open]

right now, handling absolute import seems to work only by mistake:

  • I added recently:

    if sys.version_info >= (2, 7):
       absolute_import_activated = lambda self: True

    I thought, it should be alright, but it breaks in Pylint the test "func_3k_removed_stuff_py_30"

    It might be alright that he doesn't warn:

    W:  6: Relative import 'func_w0302', should be 'input.func_w0302'

    but we should have instead a import failure...

  • py3k: the only test that does not pass in python3 is unittest_regrtest.NonRegressionTC.test_module_path : indeed the problem seems not to resolve something like:

    from . import hello

    there is no test about it, and it is the 2to3 script that lets us discover the problem:

    astng $ 2to3 test/regrtest_data/package/__init__.py
    -import subpackage
    +from . import subpackage

Pylint ticket http://www.logilab.org/ticket/6646 about false positives might also be related to import handling errors; maybe also http://www.logilab.org/ticket/20066

appeared in<not specified>
done in<not specified>
load left2.000
closed by<not specified>