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

Lib/test/test_shutil.py

index 0f78ddc5c0dfb133528e9c75425486fb0c7d6244..3d5533a7f1926725bd0a57a4fdf0190025909d82 100644 (file)
@@ -17,7 +17,7 @@ class TestShutil(unittest.TestCase):
         self.assertRaises(OSError, shutil.rmtree, filename)
 
     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)