summaryrefslogtreecommitdiff
path: root/src/flake8
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2020-05-07 12:32:25 -0700
committerAnthony Sottile <asottile@umich.edu>2020-05-07 12:34:38 -0700
commit9e67511c691d460ee46296710e40d1fbe7af0837 (patch)
treef10f98d1540ca274a81fc0601116cf85cfe6f970 /src/flake8
parent0c3b8045a7b51aec7abf19dea94d5292cebeeea0 (diff)
downloadflake8-9e67511c691d460ee46296710e40d1fbe7af0837.tar.gz
Fix using --exclude=.* to not match `.` and `..`
Diffstat (limited to 'src/flake8')
-rw-r--r--src/flake8/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flake8/utils.py b/src/flake8/utils.py
index 29df9bc..e0c221a 100644
--- a/src/flake8/utils.py
+++ b/src/flake8/utils.py
@@ -448,7 +448,7 @@ def matches_filename(path, patterns, log_message, logger):
if not patterns:
return False
basename = os.path.basename(path)
- if fnmatch(basename, patterns):
+ if basename not in {".", ".."} and fnmatch(basename, patterns):
logger.debug(log_message, {"path": basename, "whether": ""})
return True