diff mercurial/patch.py @ 38329:f47608575c10

py3: replace s[-1] with s.endswith() in eol handling
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Jun 2018 17:53:51 +0900
parents 2ce60954b1b7
children 7b12a2d2eedc
line wrap: on
line diff
--- a/mercurial/patch.py	Sat Jun 16 17:36:44 2018 +0900
+++ b/mercurial/patch.py	Sat Jun 16 17:53:51 2018 +0900
@@ -707,7 +707,7 @@
         if self.eolmode != 'strict' and eol and eol != '\n':
             rawlines = []
             for l in lines:
-                if l and l[-1] == '\n':
+                if l and l.endswith('\n'):
                     l = l[:-1] + eol
                 rawlines.append(l)
             lines = rawlines