Skip to content

Commit

Permalink
datamodel: types: fix object iteration compatibility for Python < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Frantisek Tobias authored and alesmrazek committed Sep 4, 2024
1 parent 0c3e5f3 commit 244c4ae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions manager/knot_resolver_manager/datamodel/types/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ def accessible(perm: _PermissionMode) -> bool:
return bool(dest_mode & chflags[perm][1])
return bool(dest_mode & chflags[perm][2])

for perm in perm_mode:
if not accessible(perm):
return False
# __iter__ for class enum.Flag added in python3.11
# 'for perm in perm_mode:' failes for <=python3.11
for perm in _PermissionMode:
if perm in perm_mode:
if not accessible(perm):
return False
return True


Expand Down

0 comments on commit 244c4ae

Please sign in to comment.