From 4f6394874a2ceaa74407d1fbbf6f9b047f1736ac Mon Sep 17 00:00:00 2001 From: Johannes Gijsbers Date: Sun, 12 Dec 2004 15:54:20 +0000 Subject: Backport from trunk: use os.geteuid() for checking whether we are root, as suggested by Michael Hudson. --- Lib/test/test_shutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 0f78ddc..3d5533a 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -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) -- cgit v0.12