diff options
Diffstat (limited to 'linuxnamespaces')
-rw-r--r-- | linuxnamespaces/atlocation.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index a4255a6..0003c35 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -7,7 +7,6 @@ to work with a location described in this way and this module provides support code for doing so. """ -import contextlib import enum import errno import os @@ -221,8 +220,8 @@ class AtLocation: assert self.location if self.fd == AT_FDCWD: return os.chdir(self.location) - with contextlib.closing( - FileDescriptor(self.open(flags=os.O_PATH | os.O_CLOEXEC)) + with FileDescriptor( + self.open(flags=os.O_PATH | os.O_CLOEXEC) ) as dirfd: return os.fchdir(dirfd) |