diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-08-06 13:24:20 +0200 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-08-06 13:24:20 +0200 |
commit | e1482cd02cabbcbaecc361a764f81ff66593fa5b (patch) | |
tree | 45b268b2f7bf2a1f95ae14e93cb8eb616702b559 /test | |
parent | b3109e71faf2713402f70d226617352815f6c72e (diff) |
os_open(): don't attempt to close fd if open failed.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_examples.py | 2 |
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) |