Skip to content

Commit 942aab5

Browse files
committed
Fix some issues found by lgtm.com
* This import of module shutil is redundant, as it was previously imported on line 35. * Testing for None should use the 'is' operator. * The value assigned to local variable 'hno' is never used.
1 parent c9402be commit 942aab5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

patch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def lineno(self):
368368
header.append(fe.line)
369369
fe.next()
370370
if fe.is_empty:
371-
if p == None:
371+
if p is None:
372372
debug("no patch data found") # error is shown later
373373
self.errors += 1
374374
else:
@@ -941,7 +941,6 @@ def apply(self, strip=0, root=None):
941941
if exists(backupname):
942942
warning("can't backup original file to %s - aborting" % backupname)
943943
else:
944-
import shutil
945944
shutil.move(filename, backupname)
946945
if self.write_hunks(backupname, filename, p.hunks):
947946
info("successfully patched %d/%d:\t %s" % (i+1, total, filename))
@@ -1005,7 +1004,6 @@ class NoMatch(Exception):
10051004

10061005
lineno = 1
10071006
line = fp.readline()
1008-
hno = None
10091007
try:
10101008
for hno, h in enumerate(hunks):
10111009
# skip to first line of the hunk

0 commit comments

Comments
 (0)