Skip to content

Commit

Permalink
Moved try / finally to outer scope to avoid problems under Win
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Nov 12, 2016
1 parent a61c405 commit 7e37513
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ def test_writable_not_stream():
fn = tempfile.NamedTemporaryFile()
name = fn.name
fn.close()
with writers.writable(name, 'wb') as f:
try:
try:
with writers.writable(name, 'wb') as f:
assert name == f.name
f.write(b'Segno')
finally:
os.remove(name)
finally:
os.remove(name)


def test_writable_not_stream2():
fn = tempfile.NamedTemporaryFile()
name = fn.name
fn.close()
with writers.writable(name, 'wt') as f:
try:
try:
with writers.writable(name, 'wt') as f:
assert name == f.name
f.write('Segno')
finally:
os.remove(name)
finally:
os.remove(name)


def test_writable_not_stream3():
Expand Down

0 comments on commit 7e37513

Please sign in to comment.