Skip to content

Commit a440c20

Browse files
smontanaromyint
authored andcommitted
skip Emacs/vim backup files (#331)
* skip Emacs/vim backup files * requested change
1 parent af45b41 commit a440c20

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pyflakes/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def isPythonFile(filename):
117117
if filename.endswith('.py'):
118118
return True
119119

120+
# Avoid obvious Emacs backup files
121+
if filename.endswith("~"):
122+
return False
123+
120124
max_bytes = 128
121125

122126
try:

pyflakes/test/test_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def test_recurses(self):
180180
"""
181181
os.mkdir(os.path.join(self.tempdir, 'foo'))
182182
apath = self.makeEmptyFile('foo', 'a.py')
183+
self.makeEmptyFile('foo', 'a.py~')
183184
os.mkdir(os.path.join(self.tempdir, 'bar'))
184185
bpath = self.makeEmptyFile('bar', 'b.py')
185186
cpath = self.makeEmptyFile('c.py')

0 commit comments

Comments
 (0)