tests: fix `hghave root` on windows
authorSimon Heimberg <simohe@besonet.ch>
Sat, 23 Nov 2013 01:06:20 +0100
changeset 20114 390aff33c2f9
parent 20113 7ad2ae7792ad
child 20115 db6b958c4f35
tests: fix `hghave root` on windows This lets tests\test-hghave.t pass on windows where geteuid does not exist.
tests/hghave.py
--- 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\"",