mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Move open() calls out of the try block
This commit is contained in:
parent
6651f67602
commit
4391e63b07
@ -165,8 +165,8 @@ class Config(object):
|
||||
try:
|
||||
try:
|
||||
os.chdir(dirname)
|
||||
f = open(config_file, 'U')
|
||||
try:
|
||||
f = open(config_file, 'U')
|
||||
exec f in config
|
||||
finally:
|
||||
f.close()
|
||||
|
@ -85,8 +85,8 @@ def test_quickstart_defaults(tempdir):
|
||||
conffile = tempdir / 'conf.py'
|
||||
assert conffile.isfile()
|
||||
ns = {}
|
||||
f = open(conffile, 'U')
|
||||
try:
|
||||
f = open(conffile, 'U')
|
||||
exec f in ns
|
||||
finally:
|
||||
f.close()
|
||||
@ -142,8 +142,8 @@ def test_quickstart_all_answers(tempdir):
|
||||
conffile = tempdir / 'source' / 'conf.py'
|
||||
assert conffile.isfile()
|
||||
ns = {}
|
||||
f = open(conffile, 'U')
|
||||
try:
|
||||
f = open(conffile, 'U')
|
||||
exec f in ns
|
||||
finally:
|
||||
f.close()
|
||||
|
Loading…
Reference in New Issue
Block a user