autosign: operator precedence fix

This commit is contained in:
The MMGen Project 2026-11-29 17:04:34 +00:00
commit 1f8641508f
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -203,7 +203,7 @@ class Autosign:
def check_or_create(dirname):
path = getattr(self, dirname)
if path.is_dir():
if path.stat().st_mode & S_IWUSR|S_IRUSR != S_IWUSR|S_IRUSR:
if path.stat().st_mode & (S_IWUSR|S_IRUSR) != (S_IWUSR|S_IRUSR):
die(1, f'‘{path}’ is not read/write for this user!')
elif path.exists():
die(1, f'‘{path}’ is not a directory!')