Move open() calls out of the try block

This commit is contained in:
Daniel Neuhäuser 2010-05-01 20:26:05 +02:00
parent 6651f67602
commit 4391e63b07
2 changed files with 3 additions and 3 deletions

View File

@ -165,8 +165,8 @@ class Config(object):
try:
try:
os.chdir(dirname)
try:
f = open(config_file, 'U')
try:
exec f in config
finally:
f.close()

View File

@ -85,8 +85,8 @@ def test_quickstart_defaults(tempdir):
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
try:
f = open(conffile, 'U')
try:
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 = {}
try:
f = open(conffile, 'U')
try:
exec f in ns
finally:
f.close()