changeset 43362:ddfd0f3956f4 stable

py3: fix fsmonitor's _handleunavailable exception message encoding Differential Revision: https://phab.mercurial-scm.org/D7196
author Emmanuel Leblond <emmanuel.leblond@gmail.com>
date Fri, 01 Nov 2019 10:57:31 -0700
parents 9892599de2dc
children 2ded39ef5bf7
files hgext/fsmonitor/__init__.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fsmonitor/__init__.py	Fri Nov 01 14:54:08 2019 +0100
+++ b/hgext/fsmonitor/__init__.py	Fri Nov 01 10:57:31 2019 -0700
@@ -132,6 +132,7 @@
     util,
 )
 from mercurial import match as matchmod
+from mercurial.utils import stringutil
 
 from . import (
     pywatchman,
@@ -207,8 +208,8 @@
     if isinstance(ex, watchmanclient.Unavailable):
         # experimental config: fsmonitor.verbose
         if ex.warn and ui.configbool(b'fsmonitor', b'verbose'):
-            if b'illegal_fstypes' not in str(ex):
-                ui.warn(str(ex) + b'\n')
+            if b'illegal_fstypes' not in stringutil.forcebytestr(ex):
+                ui.warn(stringutil.forcebytestr(ex) + b'\n')
         if ex.invalidate:
             state.invalidate()
         # experimental config: fsmonitor.verbose