mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
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:
parent
d38781d71d
commit
fca94336d3
1 changed files with 2 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue