##// END OF EJS Templates
config: guard against setconfig specifying unicode values on py3...
Augie Fackler -
r31306:c920efa9 default
parent child Browse files
Show More
@@ -13,6 +13,7 b' import os'
13 from .i18n import _
13 from .i18n import _
14 from . import (
14 from . import (
15 error,
15 error,
16 pycompat,
16 util,
17 util,
17 )
18 )
18
19
@@ -69,6 +70,9 b' class config(object):'
69 def items(self, section):
70 def items(self, section):
70 return self._data.get(section, {}).items()
71 return self._data.get(section, {}).items()
71 def set(self, section, item, value, source=""):
72 def set(self, section, item, value, source=""):
73 if pycompat.ispy3:
74 assert not isinstance(value, str), (
75 'config values may not be unicode strings on Python 3')
72 if section not in self:
76 if section not in self:
73 self._data[section] = util.sortdict()
77 self._data[section] = util.sortdict()
74 self._data[section][item] = value
78 self._data[section][item] = value
General Comments 0
You need to be logged in to leave comments. Login now