mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix typo and add test case.
This commit is contained in:
parent
31c604d3a7
commit
42d544505f
2 changed files with 19 additions and 5 deletions
|
@ -493,11 +493,10 @@ class RawConfigParser:
|
|||
read_ok = []
|
||||
for filename in filenames:
|
||||
try:
|
||||
fp = open(filename, encoding=encoding)
|
||||
with open(filename, encoding=encoding) as fp:
|
||||
self._read(fp, filename)
|
||||
except IOError:
|
||||
continue
|
||||
self._read(fp, filename)
|
||||
fp.close()
|
||||
read_ok.append(filename)
|
||||
return read_ok
|
||||
|
||||
|
@ -511,7 +510,7 @@ class RawConfigParser:
|
|||
"""
|
||||
if source is None:
|
||||
try:
|
||||
srouce = f.name
|
||||
source = f.name
|
||||
except AttributeError:
|
||||
source = '<???>'
|
||||
self._read(f, source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue