Patchwork D11906: hghave: fix the check for suid on platforms lacking support

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2021, 6:11 a.m.
Message ID <differential-rev-PHID-DREV-ikmnwemkooavagrbbyar-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50232/
State New
Headers show

Comments

phabricator - Dec. 13, 2021, 6:11 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The mac tests were raising an AttributeError without the default arg.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11906

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -266,7 +266,10 @@ 
 
 @check("suidbit", "setuid and setgid bit")
 def has_suidbit():
-    if getattr(os, "statvfs", None) is None or getattr(os, "ST_NOSUID") is None:
+    if (
+        getattr(os, "statvfs", None) is None
+        or getattr(os, "ST_NOSUID", None) is None
+    ):
         return False
     return bool(os.statvfs('.').f_flag & os.ST_NOSUID)