changeset 40530:99d5424eedc8

contrib: fix import-checker to not b'' module names on Python 3 Caught by the doctests. Differential Revision: https://phab.mercurial-scm.org/D5205
author Augie Fackler <augie@google.com>
date Thu, 01 Nov 2018 15:43:43 -0400
parents 176c26a21123
children 90517fad4293
files contrib/import-checker.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/import-checker.py	Thu Nov 01 15:47:26 2018 -0400
+++ b/contrib/import-checker.py	Thu Nov 01 15:43:43 2018 -0400
@@ -674,6 +674,8 @@
         # "starts" is "line number" (1-origin), but embedded() is
         # expected to return "line offset" (0-origin). Therefore, this
         # yields "starts - 1".
+        if not isinstance(modname, str):
+            modname = modname.decode('utf8')
         yield code, "%s[%d]" % (modname, starts), name, starts - 1
 
 def sources(f, modname):