diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-14 16:22:00 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-07-14 16:22:00 +0300 |
commit | 72cd3b2d573b6a1331d2cfd4c52f230da76f8f84 (patch) | |
tree | 0d77076cbbe52c0802db34360a42c6853ae0cc5e /pylint/checkers/variables.py | |
parent | c90eae70b2d8974027b749f6996488a0b1a8903b (diff) | |
download | pylint-72cd3b2d573b6a1331d2cfd4c52f230da76f8f84.tar.gz |
Improve detection of relative imports in non-packages, as well as importing missing modules with a relative import from a package.
The change improves how relative imports are shown when they are missing,
with the absolute name, instead of the relative one.
Diffstat (limited to 'pylint/checkers/variables.py')
-rw-r--r-- | pylint/checkers/variables.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 3156f6f..2821283 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1009,7 +1009,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' name_parts = node.modname.split('.') level = getattr(node, 'level', None) try: - module = node.root().import_module(name_parts[0], level=level) + module = node.do_import_module(name_parts[0]) except Exception: return module = self._check_module_attrs(node, module, name_parts[1:]) |