diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
commit | 70a6b49821a3226f55e9716f32d802d06640cb89 (patch) | |
tree | 3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Lib/ConfigParser.py | |
parent | ecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff) | |
download | cpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2 |
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Lib/ConfigParser.py')
-rw-r--r-- | Lib/ConfigParser.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py index d98993a..e12717d 100644 --- a/Lib/ConfigParser.py +++ b/Lib/ConfigParser.py @@ -118,7 +118,7 @@ class NoSectionError(Error): """Raised when no section matches a requested option.""" def __init__(self, section): - Error.__init__(self, 'No section: ' + `section`) + Error.__init__(self, 'No section: %r' % (section,)) self.section = section class DuplicateSectionError(Error): @@ -191,7 +191,7 @@ class MissingSectionHeaderError(ParsingError): def __init__(self, filename, lineno, line): Error.__init__( self, - 'File contains no section headers.\nfile: %s, line: %d\n%s' % + 'File contains no section headers.\nfile: %s, line: %d\n%r' % (filename, lineno, line)) self.filename = filename self.lineno = lineno @@ -453,7 +453,7 @@ class RawConfigParser: optname = None # no section header in the file? elif cursect is None: - raise MissingSectionHeaderError(fpname, lineno, `line`) + raise MissingSectionHeaderError(fpname, lineno, line) # an option line? else: mo = self.OPTCRE.match(line) @@ -478,7 +478,7 @@ class RawConfigParser: # list of all bogus lines if not e: e = ParsingError(fpname) - e.append(lineno, `line`) + e.append(lineno, repr(line)) # if any parsing errors occurred, raise an exception if e: raise e @@ -613,4 +613,4 @@ class SafeConfigParser(ConfigParser): else: raise InterpolationSyntaxError( option, section, - "'%' must be followed by '%' or '(', found: " + `rest`) + "'%%' must be followed by '%%' or '(', found: %r" % (rest,)) |