Patchwork D7855: fsmonitor: properly handle str ex.msg

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2020, 4:13 p.m.
Message ID <dda1c424dad0759b372bf1f9f3a3acf5@localhost.localdomain>
Download mbox | patch
Permalink /patch/44318/
State Not Applicable
Headers show

Comments

phabricator - Jan. 14, 2020, 4:13 p.m.
Closed by commit rHG18f9a534dfb7: fsmonitor: properly handle str ex.msg (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7855?vs=19196&id=19215

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7855/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7855

AFFECTED FILES
  hgext/fsmonitor/watchmanclient.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/fsmonitor/watchmanclient.py b/hgext/fsmonitor/watchmanclient.py
--- a/hgext/fsmonitor/watchmanclient.py
+++ b/hgext/fsmonitor/watchmanclient.py
@@ -105,11 +105,11 @@ 
                 )
             return self._watchmanclient.query(*watchmanargs)
         except pywatchman.CommandError as ex:
-            if b'unable to resolve root' in ex.msg:
+            if 'unable to resolve root' in ex.msg:
                 raise WatchmanNoRoot(
                     self._root, stringutil.forcebytestr(ex.msg)
                 )
-            raise Unavailable(ex.msg)
+            raise Unavailable(stringutil.forcebytestr(ex.msg))
         except pywatchman.WatchmanError as ex:
             raise Unavailable(stringutil.forcebytestr(ex))