diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index 3714ecdea..94dc0a98c 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.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 diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index d91f61b6f..9bb5ba775 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -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