mesonlib: Fix FileMode type annotations

pull/8884/head
Dylan Baker 3 years ago
parent 5d3a60ae65
commit 86da131129
  1. 4
      mesonbuild/mesonlib/universal.py
  2. 3
      mesonbuild/minstall.py

@ -298,8 +298,8 @@ class FileMode:
'[r-][w-][xsS-]' # Group perms
'[r-][w-][xtT-]') # Others perms
def __init__(self, perms: T.Optional[str] = None, owner: T.Optional[str] = None,
group: T.Optional[str] = None):
def __init__(self, perms: T.Optional[str] = None, owner: T.Union[str, int, None] = None,
group: T.Union[str, int, None] = None):
self.perms_s = perms
self.perms = self.perms_s_to_bits(perms)
self.owner = owner

@ -130,7 +130,8 @@ def append_to_log(lf: T.TextIO, line: str) -> None:
lf.flush()
def set_chown(path: str, user: T.Optional[str] = None, group: T.Optional[str] = None,
def set_chown(path: str, user: T.Union[str, int, None] = None,
group: T.Union[str, int, None] = None,
dir_fd: T.Optional[int] = None, follow_symlinks: bool = True) -> None:
# shutil.chown will call os.chown without passing all the parameters
# and particularly follow_symlinks, thus we replace it temporary

Loading…
Cancel
Save