Skip to content

Commit 240a39d

Browse files
committed
Python 3 debug fixes
1 parent b8e9ca4 commit 240a39d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

patch.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -689,25 +689,24 @@ def _normalize_filenames(self):
689689
690690
[x] always use forward slashes to be crossplatform
691691
(diff/patch were born as a unix utility after all)
692-
692+
693693
return None
694694
"""
695695
if debugmode:
696696
debug("normalize filenames")
697697
for i,p in enumerate(self.items):
698698
if debugmode:
699-
debug(" patch type = " + p.type)
700-
debug(" source = " + p.source)
701-
debug(" target = " + p.target)
699+
debug(" patch type = %s" % p.type)
700+
debug(" source = %s" % p.source)
701+
debug(" target = %s" % p.target)
702702
if p.type in (HG, GIT):
703-
# TODO: figure out how to deal with /dev/null entries
704703
debug("stripping a/ and b/ prefixes")
705-
if p.source != '/dev/null':
704+
if p.source != b'/dev/null':
706705
if not p.source.startswith(b"a/"):
707706
warning("invalid source filename")
708707
else:
709708
p.source = p.source[2:]
710-
if p.target != '/dev/null':
709+
if p.target != b'/dev/null':
711710
if not p.target.startswith(b"b/"):
712711
warning("invalid target filename")
713712
else:

0 commit comments

Comments
 (0)