py3: use stringutil.forcebytestr() to convert error messages to bytes
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 12 Apr 2018 17:21:56 +0530
changeset 37585 df4fd29c0854
parent 37584 fd0e6678ba0f
child 37586 b94fecf4cd8c
py3: use stringutil.forcebytestr() to convert error messages to bytes Differential Revision: https://phab.mercurial-scm.org/D3284
mercurial/subrepoutil.py
--- a/mercurial/subrepoutil.py	Thu Apr 12 08:06:39 2018 -0700
+++ b/mercurial/subrepoutil.py	Thu Apr 12 17:21:56 2018 +0530
@@ -86,7 +86,8 @@
                 src = re.sub(pattern, repl, src, 1)
             except re.error as e:
                 raise error.Abort(_("bad subrepository pattern in %s: %s")
-                                 % (p.source('subpaths', pattern), e))
+                                 % (p.source('subpaths', pattern),
+                                    stringutil.forcebytestr(e)))
         return src
 
     state = {}