changeset 39708:fe28267d5223

py3: byteify contrib/check-config.py The corresponding *.t still fails because of bytes (with a 'b' prefix) vs str printing, but no longer crashes. # skip-blame for b'' prefixing
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 18 Sep 2018 23:56:38 -0400
parents 5abc47d4ca6b
children 254361f727bd
files contrib/check-config.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-config.py	Tue Sep 18 23:47:21 2018 -0400
+++ b/contrib/check-config.py	Tue Sep 18 23:56:38 2018 -0400
@@ -104,12 +104,12 @@
                 ctype = m.group('ctype')
                 if not ctype:
                     ctype = 'str'
-                name = m.group('section') + "." + m.group('option')
+                name = m.group('section') + b"." + m.group('option')
                 default = m.group('default')
                 if default in (None, 'False', 'None', '0', '[]', '""', "''"):
-                    default = ''
+                    default = b''
                 if re.match(b'[a-z.]+$', default):
-                    default = '<variable>'
+                    default = b'<variable>'
                 if (name in foundopts and (ctype, default) != foundopts[name]
                     and name not in allowinconsistent):
                     print(l.rstrip())
@@ -117,19 +117,19 @@
                                                         foundopts[name]))
                     print("at %s:%d:" % (f, linenum))
                 foundopts[name] = (ctype, default)
-                carryover = ''
+                carryover = b''
             else:
                 m = re.search(configpartialre, line)
                 if m:
                     carryover = line
                 else:
-                    carryover = ''
+                    carryover = b''
 
     for name in sorted(foundopts):
         if name not in documented:
-            if not (name.startswith("devel.") or
-                    name.startswith("experimental.") or
-                    name.startswith("debug.")):
+            if not (name.startswith(b"devel.") or
+                    name.startswith(b"experimental.") or
+                    name.startswith(b"debug.")):
                 ctype, default = foundopts[name]
                 if default:
                     default = ' [%s]' % default