treesum: don't use dir_fd parameter in os.scandir()
This parameter was added in python 3.7, but we're only depending on 3.6 for RHEL. Pass a path to `/proc/self/fd/...` instead.
This commit is contained in:
parent
2c564afae8
commit
7754fd8e78
1 changed files with 1 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ def treesum(m, dir_fd):
|
|||
The file, symlink and directory names and contents are recursively
|
||||
hashed, together with security-relevant metadata."""
|
||||
|
||||
with os.scandir(dir_fd) as it:
|
||||
with os.scandir(f"/proc/self/fd/{dir_fd}") as it:
|
||||
for dirent in sorted(it, key=(lambda d: d.name)):
|
||||
stat_result = dirent.stat(follow_symlinks=False)
|
||||
metadata = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue