mach: Add comment to ignore type on geteuid as it only available on unix (#38388)

Currently pyrefly have an issues with top level assertion on platform
gating, so we decide to ignore it for now.

https://github.com/facebook/pyrefly/issues/795

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
This commit is contained in:
Jerens Lensun 2025-07-31 18:25:02 +08:00 committed by GitHub
parent d38781d71d
commit fca94336d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -286,13 +286,13 @@ class Linux(Base):
return False
def check_sudo() -> bool:
if os.geteuid() != 0:
if os.geteuid() != 0: # pyrefly: ignore[missing-attribute]
if shutil.which("sudo") is None:
return False
return True
def run_as_root(command: list[str], force: bool = False) -> int:
if os.geteuid() != 0:
if os.geteuid() != 0: # pyrefly: ignore[missing-attribute]
command.insert(0, "sudo")
if force:
command.append("-y")