]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use os.geteuid() for checking whether we are root, as suggested by
authorJohannes Gijsbers <jlg@dds.nl>
Sun, 12 Dec 2004 15:52:57 +0000 (15:52 +0000)
committerJohannes Gijsbers <jlg@dds.nl>
Sun, 12 Dec 2004 15:52:57 +0000 (15:52 +0000)
Michael Hudson.

Lib/test/test_shutil.py

index c28e5a3a4833757ef75071d9a0920b7a944d4899..7c2860272a741de19beabc25de85af6b07d2b46b 100644 (file)
@@ -19,7 +19,7 @@ class TestShutil(unittest.TestCase):
     # See bug #1071513 for why we don't run this on cygwin
     # and bug #1076467 for why we don't run this as root.
     if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin'
-        and os.getenv('USER') != 'root'):
+        and not (hasattr(os, 'geteuid') and os.geteuid() == 0)):
         def test_on_error(self):
             self.errorState = 0
             os.mkdir(TESTFN)