tests/hghave.py
changeset 1312 c44d24e2fc66
parent 1311 1fed120bfa04
child 1323 aeb658c7dbc7
equal deleted inserted replaced
1309:02972bce7d41 1312:c44d24e2fc66
   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)