Patchwork [2,of,5,stable] ui: fix configbytes isinstance check to look for bytes and not str

login
register
mail settings
Submitter Augie Fackler
Date July 24, 2017, 9:08 p.m.
Message ID <50d37101218f32625d36.1500930490@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/22544/
State Accepted
Headers show

Comments

Augie Fackler - July 24, 2017, 9:08 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1500918625 14400
#      Mon Jul 24 13:50:25 2017 -0400
# Branch stable
# Node ID 50d37101218f32625d36b632e25e52f588e8d925
# Parent  a67471f29dbb38e5ac51a9bacf4bb5fff076e1bb
ui: fix configbytes isinstance check to look for bytes and not str

Fixes configbytes on Python 3.

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -648,7 +648,7 @@  class ui(object):
             if default is _unset:
                 default = 0
             value = default
-        if not isinstance(value, str):
+        if not isinstance(value, bytes):
             return value
         try:
             return util.sizetoint(value)