diff options
author | Hornwitser <github@hornwitser.no> | 2018-08-23 23:58:15 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-09-04 08:58:47 +0200 |
commit | d7688d3c3ae64b491e1183a9067b066de69cb3cb (patch) | |
tree | d8226969d2a1c1f669bc1b468bac21cd2bfe61e9 | |
parent | 5b0bc777e8688879226274f63775b3c2aa5a10de (diff) | |
download | pylint-git-d7688d3c3ae64b491e1183a9067b066de69cb3cb.tar.gz |
Revert "Don't emit import-self and cyclic-import..."
Reverts commit bcf801f "Don't emit import-self and cyclic-import for
relative imports of modules with the same name as the package itself."
The value from astroid.modutils.get_module_part no longer returns just
the package from a module import, as indicated by the unit tests passing
without the filtering code.
-rw-r--r-- | pylint/checkers/imports.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 4101c35a4..792c742ef 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -694,15 +694,6 @@ class ImportsChecker(BaseChecker): context_name = node.root().name base = os.path.splitext(os.path.basename(module_file))[0] - # Determine if we have a `from .something import` in a package's - # __init__. This means the module will never be able to import - # itself using this condition (the level will be bigger or - # if the same module is named as the package, it will be different - # anyway). - if isinstance(node, astroid.ImportFrom): - if node.level and node.level > 0 and base == '__init__': - return - try: importedmodname = get_module_part(importedmodname, module_file) |