summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-08-13 13:20:57 -0400
committerGitHub <noreply@github.com>2022-08-13 19:20:57 +0200
commit6f9c371c4f82281570869be2e4c609844bfd8c34 (patch)
tree355ae04c1a3b2121082ef8d61343ce4564905519 /pylint/lint
parent93ee0a039de2d6aa99c4871b0b9d3db53fddf437 (diff)
downloadpylint-git-6f9c371c4f82281570869be2e4c609844bfd8c34.tar.gz
Revert "Fix the failure to lint modules contained under an identically named directory" (#7304)
This reverts commit 3ebb700aed88a427011c2e88705f66ec0b3830a4. * Add regression test for namespace packages under directory on path * Fix expected result in `test_relative_beyond_top_level_two`
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/expand_modules.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py
index d5fe60661..27d4bd812 100644
--- a/pylint/lint/expand_modules.py
+++ b/pylint/lint/expand_modules.py
@@ -82,10 +82,8 @@ def expand_modules(
continue
module_path = get_python_path(something)
additional_search_path = [".", module_path] + path
- if os.path.isfile(something) or os.path.exists(
- os.path.join(something, "__init__.py")
- ):
- # this is a file or a directory with an explicit __init__.py
+ if os.path.exists(something):
+ # this is a file or a directory
try:
modname = ".".join(
modutils.modpath_from_file(something, path=additional_search_path)