[PATCH 4 of 5] py3: replace bytes[n] with slicing in checkwinfilename()

Yuya Nishihara yuya at tcha.org
Wed Sep 27 08:34:41 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1506507223 -32400
#      Wed Sep 27 19:13:43 2017 +0900
# Node ID b75831c83770a3ce9d9c84112cec6c6807563db1
# Parent  1f783de54c8cce12807b92f41a670d16fbbad6aa
py3: replace bytes[n] with slicing in checkwinfilename()

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1290,7 +1290,7 @@ def checkwinfilename(path):
         if base and base.lower() in _winreservednames:
             return _("filename contains '%s', which is reserved "
                      "on Windows") % base
-        t = n[-1]
+        t = n[-1:]
         if t in '. ' and n not in '..':
             return _("filename ends with '%s', which is not allowed "
                      "on Windows") % t


More information about the Mercurial-devel mailing list