Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.66 diff -u -r1.66 ConfigParser.py --- ConfigParser.py 18 May 2004 04:24:02 -0000 1.66 +++ ConfigParser.py 23 Sep 2004 14:24:30 -0000 @@ -92,7 +92,8 @@ __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", "InterpolationError", "InterpolationDepthError", "InterpolationSyntaxError", "ParsingError", - "MissingSectionHeaderError", "ConfigParser", "SafeConfigParser", + "MissingSectionHeaderError", + "ConfigParser", "SafeConfigParser", "RawConfigParser", "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"] DEFAULTSECT = "DEFAULT" @@ -348,8 +349,6 @@ def set(self, section, option, value): """Set an option.""" - if not isinstance(value, basestring): - raise TypeError("option values must be strings") if not section or section == DEFAULTSECT: sectdict = self._defaults else: @@ -631,3 +630,9 @@ raise InterpolationSyntaxError( option, section, "'%%' must be followed by '%%' or '(', found: %r" % (rest,)) + + def set(self, section, option, value): + """Set an option. Extend ConfigParser.set: check for string values.""" + if not isinstance(value, basestring): + raise TypeError("option values must be strings") + ConfigParser.set(self, section, option, value)