Skip to content

Commit 05f6941

Browse files
Merge pull request #199 from gjsd2/quiet-tape-pscsi
Silently ignore OSError on os.close()
2 parents a03594b + c523861 commit 05f6941

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rtslib/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def is_dev_in_use(path):
115115
except OSError:
116116
return True
117117
else:
118-
os.close(file_fd)
118+
try:
119+
os.close(file_fd)
120+
except OSError:
121+
pass
119122
return False
120123

121124
def _get_size_for_dev(device):

0 commit comments

Comments
 (0)