diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-04-03 09:24:33 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-04-03 09:24:33 +0200 |
commit | ff3d733095f23068056e8e3273a343d10149e87e (patch) | |
tree | ba04e423b97067a7d01a8406eb1109d016593f6e | |
parent | 9a74a955291e6232543e1a08e48066a930cfca5a (diff) | |
download | python-linuxnamespaces-ff3d733095f23068056e8e3273a343d10149e87e.tar.gz |
AtLocation.walk: add support for AT_EMPTY_PATH
-rw-r--r-- | linuxnamespaces/atlocation.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index 24c2cce..6aada55 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -505,7 +505,7 @@ class AtLocation: AtLocations referencing the same object as the dirpath though as an AT_EMPTY_PATH with temporary fd. """ - if self.flags != AtFlags.NONE: + if self.flags & ~AtFlags.AT_EMPTY_PATH != AtFlags.NONE: raise NotImplementedError( "walk is not supported for an AtLocation with flags" ) @@ -513,7 +513,7 @@ class AtLocation: if follow_symlinks: flags = AtFlags.NONE for dirpath, dirnames, filenames, dirfd in os.fwalk( - self.location, + "." if self.flags & AtFlags.AT_EMPTY_PATH else self.location, topdown=topdown, onerror=onerror, follow_symlinks=follow_symlinks, |