Skip to content

Commit

Permalink
mypy: replace fchmod by chmod
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bruchar1 authored and eli-schwartz committed Sep 26, 2023
1 parent 5b317c5 commit a843a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/scripts/depfixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def open_bf(self, bfile: str) -> None:
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
Expand Down

0 comments on commit a843a99

Please sign in to comment.