comparison tests/hghave.py @ 48441:f21e7748c257 stable

hghave: fix the check for suid on platforms lacking support The mac tests were raising an AttributeError without the default arg. Differential Revision: https://phab.mercurial-scm.org/D11906
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 13 Dec 2021 00:18:31 -0500
parents 6505d3902eac
children f447b90a4b11
comparison
equal deleted inserted replaced
48440:cb477edeca79 48441:f21e7748c257
264 return not (new_file_has_exec or exec_flags_cannot_flip) 264 return not (new_file_has_exec or exec_flags_cannot_flip)
265 265
266 266
267 @check("suidbit", "setuid and setgid bit") 267 @check("suidbit", "setuid and setgid bit")
268 def has_suidbit(): 268 def has_suidbit():
269 if getattr(os, "statvfs", None) is None or getattr(os, "ST_NOSUID") is None: 269 if (
270 getattr(os, "statvfs", None) is None
271 or getattr(os, "ST_NOSUID", None) is None
272 ):
270 return False 273 return False
271 return bool(os.statvfs('.').f_flag & os.ST_NOSUID) 274 return bool(os.statvfs('.').f_flag & os.ST_NOSUID)
272 275
273 276
274 @check("icasefs", "case insensitive file system") 277 @check("icasefs", "case insensitive file system")