objectstore: fix Object._open exception handling
Move the call to os.open outside of the try block so that if an exception occurs it will be properly propagated to the callers.
This commit is contained in:
parent
007488488e
commit
c73a28613b
1 changed files with 1 additions and 1 deletions
|
|
@ -129,8 +129,8 @@ class Object:
|
|||
@contextlib.contextmanager
|
||||
def _open(self):
|
||||
"""Open the directory and return the file descriptor"""
|
||||
fd = os.open(self._path, os.O_DIRECTORY)
|
||||
try:
|
||||
fd = os.open(self._path, os.O_DIRECTORY)
|
||||
yield fd
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue