tests/hghave.py
branchstable
changeset 1311 1fed120bfa04
parent 1303 94e35118a756
child 1323 aeb658c7dbc7
equal deleted inserted replaced
1310:21d35cf4933e 1311:1fed120bfa04
   232         return True
   232         return True
   233     finally:
   233     finally:
   234         os.rmdir(d)
   234         os.rmdir(d)
   235 
   235 
   236 def has_root():
   236 def has_root():
   237     return os.geteuid() == 0
   237     return getattr(os, 'geteuid', None) and os.geteuid() == 0
   238 
   238 
   239 def has_pyflakes():
   239 def has_pyflakes():
   240     return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
   240     return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
   241                        r"<stdin>:1: 're' imported but unused",
   241                        r"<stdin>:1: 're' imported but unused",
   242                        True)
   242                        True)