Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
else:
compat_next = lambda gen: gen.__next__()

if PY3K:
compat_stdin = sys.stdin.buffer
else:
compat_stdin = sys.stdin

def tostr(b):
""" Python 3 bytes encoder. Used to print filename in
diffstat output. Assumes that filenames are in utf-8.
Expand Down Expand Up @@ -1163,7 +1168,7 @@ def main():
setdebug() # this sets global debugmode variable

if readstdin:
patch = PatchSet(sys.stdin)
patch = PatchSet(compat_stdin)
else:
patchfile = args[0]
urltest = patchfile.split(':')[0]
Expand Down