diff --git a/patch.py b/patch.py index 4b82af0..79b1540 100755 --- a/patch.py +++ b/patch.py @@ -368,7 +368,7 @@ def lineno(self): header.append(fe.line) fe.next() if fe.is_empty: - if p == None: + if p is None: debug("no patch data found") # error is shown later self.errors += 1 else: @@ -941,7 +941,6 @@ def apply(self, strip=0, root=None): if exists(backupname): warning("can't backup original file to %s - aborting" % backupname) else: - import shutil shutil.move(filename, backupname) if self.write_hunks(backupname, filename, p.hunks): info("successfully patched %d/%d:\t %s" % (i+1, total, filename)) @@ -1005,7 +1004,6 @@ class NoMatch(Exception): lineno = 1 line = fp.readline() - hno = None try: for hno, h in enumerate(hunks): # skip to first line of the hunk