# HG changeset patch # User Pulkit Goyal # Date 1536958781 -10800 # Node ID 5a2bf7f941fa392322a4edd6ea40aec19f7d4fdc # Parent a658f97c1ce4e26a4642c192dd524da6c3720329 py3: slice through bytes to prevent getting ascii value I still don't know why python-dev thought it was a nice idea to do this. Differential Revision: https://phab.mercurial-scm.org/D4589 diff -r a658f97c1ce4 -r 5a2bf7f941fa mercurial/patch.py --- a/mercurial/patch.py Thu Sep 13 16:22:53 2018 -0400 +++ b/mercurial/patch.py Fri Sep 14 23:59:41 2018 +0300 @@ -2431,9 +2431,9 @@ a = '' b = '' for line in hunklines: - if line[0] == '-': + if line[0:1] == '-': a += line[1:] - elif line[0] == '+': + elif line[0:1] == '+': b += line[1:] else: raise error.ProgrammingError('unexpected hunk line: %s' % line)