mypy: replace fchmod by chmod

The former is unix-only, which complains when running on the Windows
platform -- even though this code is in a unix-specific branch.

But per the docs:

> As of Python 3.3, this is equivalent to os.chmod(fd, mode).

So we can just use the identical function that is available in more
places.
This commit is contained in:
Charles Brunet 2023-09-06 09:21:01 -04:00 committed by Eli Schwartz
parent 5b317c5658
commit a843a99743
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class Elf(DataSizes):
def close_bf(self) -> None:
if self.bf is not None:
if self.bf_perms is not None:
os.fchmod(self.bf.fileno(), self.bf_perms)
os.chmod(self.bf.fileno(), self.bf_perms)
self.bf_perms = None
self.bf.close()
self.bf = None