aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-08-06 13:24:20 +0200
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-08-06 13:24:20 +0200
commite1482cd02cabbcbaecc361a764f81ff66593fa5b (patch)
tree45b268b2f7bf2a1f95ae14e93cb8eb616702b559 /test
parentb3109e71faf2713402f70d226617352815f6c72e (diff)
os_open(): don't attempt to close fd if open failed.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_examples.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_examples.py b/test/test_examples.py
index f9badad..e20b47c 100755
--- a/test/test_examples.py
+++ b/test/test_examples.py
@@ -290,8 +290,8 @@ def test_cuse(capfd):
@contextmanager
def os_open(name, flags):
+ fd = os.open(name, flags)
try:
- fd = os.open(name, flags)
yield fd
finally:
os.close(fd)