comparison mercurial/ui.py @ 33585:d90f9e4704de stable

ui: fix configbytes isinstance check to look for bytes and not str Fixes configbytes on Python 3.
author Augie Fackler <augie@google.com>
date Mon, 24 Jul 2017 13:50:25 -0400
parents 0407a51b9d8c
children cc047a733f69 6294654453ee
comparison
equal deleted inserted replaced
33584:ea8c2478c907 33585:d90f9e4704de
646 value = self._config(section, name, default, untrusted) 646 value = self._config(section, name, default, untrusted)
647 if value is _unset: 647 if value is _unset:
648 if default is _unset: 648 if default is _unset:
649 default = 0 649 default = 0
650 value = default 650 value = default
651 if not isinstance(value, str): 651 if not isinstance(value, bytes):
652 return value 652 return value
653 try: 653 try:
654 return util.sizetoint(value) 654 return util.sizetoint(value)
655 except error.ParseError: 655 except error.ParseError:
656 raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')") 656 raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')")