mirror of
https://github.com/python/cpython.git
synced 2025-09-11 03:07:01 +00:00
Patch# 1258 by Christian Heimes: kill basestring.
I like this because it makes the code shorter! :-)
This commit is contained in:
parent
60d241f135
commit
3172c5d263
77 changed files with 171 additions and 217 deletions
|
@ -271,7 +271,7 @@ class RawConfigParser:
|
|||
|
||||
Return list of successfully read files.
|
||||
"""
|
||||
if isinstance(filenames, basestring):
|
||||
if isinstance(filenames, str):
|
||||
filenames = [filenames]
|
||||
read_ok = []
|
||||
for filename in filenames:
|
||||
|
@ -652,7 +652,7 @@ class SafeConfigParser(ConfigParser):
|
|||
|
||||
def set(self, section, option, value):
|
||||
"""Set an option. Extend ConfigParser.set: check for string values."""
|
||||
if not isinstance(value, basestring):
|
||||
if not isinstance(value, str):
|
||||
raise TypeError("option values must be strings")
|
||||
# check for bad percent signs:
|
||||
# first, replace all "good" interpolations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue