Commit Graph

1 Commits

Author SHA1 Message Date
Craig Citro
d03b949b64 Use the full filename for identifying __init__.py. (#1461)
Previously, `pylint.utils.expand_modules` identified `__init__.py` files by a
substring match, which led to false positives for files with names like
`flycheck__init__.py`. (While users are unlikely to choose such a filename,
tools like flycheck use these sorts of filenames for temporary files.)

The result was that `pylint` would end up linting the entire package, not just
the file in question.

The fix is straightforward -- we use `os.path.basename` instead of a substring
check, and add a test.
2017-05-22 14:42:45 +02:00