changeset 36572:9adfa48792a7

match: some minimal pycompat fixes guided by test-hgignore.t Differential Revision: https://phab.mercurial-scm.org/D2551
author Augie Fackler <augie@google.com>
date Fri, 02 Mar 2018 00:37:55 -0500
parents 5a3f8da663e5
children 9b6b02a5b589
files mercurial/match.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Fri Mar 02 00:37:07 2018 -0500
+++ b/mercurial/match.py	Fri Mar 02 00:37:55 2018 -0500
@@ -16,6 +16,7 @@
     encoding,
     error,
     pathutil,
+    pycompat,
     util,
 )
 
@@ -226,7 +227,7 @@
             except IOError as inst:
                 if warn:
                     warn(_("skipping unreadable pattern file '%s': %s\n") %
-                         (pat, inst.strerror))
+                         (pat, util.forcebytestr(inst.strerror)))
             continue
         # else: re or relre - which cannot be normalized
         kindpats.append((kind, pat, ''))
@@ -428,7 +429,7 @@
 
     @encoding.strmethod
     def __repr__(self):
-        return ('<includematcher includes=%r>' % self._pats)
+        return ('<includematcher includes=%r>' % pycompat.bytestr(self._pats))
 
 class exactmatcher(basematcher):
     '''Matches the input files exactly. They are interpreted as paths, not