changeset 20114:390aff33c2f9

tests: fix `hghave root` on windows This lets tests\test-hghave.t pass on windows where geteuid does not exist.
author Simon Heimberg <simohe@besonet.ch>
date Sat, 23 Nov 2013 01:06:20 +0100
parents 7ad2ae7792ad
children db6b958c4f35
files tests/hghave.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Wed Nov 20 12:55:08 2013 +0000
+++ b/tests/hghave.py	Sat Nov 23 01:06:20 2013 +0100
@@ -234,7 +234,7 @@
         os.rmdir(d)
 
 def has_root():
-    return os.geteuid() == 0
+    return getattr(os, 'geteuid', None) and os.geteuid() == 0
 
 def has_pyflakes():
     return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",