From: Nikolaus Rath Date: Sun, 6 Aug 2017 11:24:20 +0000 (+0200) Subject: os_open(): don't attempt to close fd if open failed. X-Git-Tag: fuse-3.1.1~1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e1482cd02cabbcbaecc361a764f81ff66593fa5b;p=qemu-gpiodev%2Flibfuse.git os_open(): don't attempt to close fd if open failed. --- 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)