diff options
author | Johannes Gijsbers <jlg@dds.nl> | 2004-12-12 15:52:57 (GMT) |
---|---|---|
committer | Johannes Gijsbers <jlg@dds.nl> | 2004-12-12 15:52:57 (GMT) |
commit | 6b220b03555171c1d2d9666a79391542d989b280 (patch) | |
tree | 6ead90f1c4bcaa81d91ee924ec85b4e0c69a6733 /Lib/test/test_shutil.py | |
parent | eb68be465fcce88f39505ddc1c9e583c3c8f8125 (diff) | |
download | cpython-6b220b03555171c1d2d9666a79391542d989b280.zip cpython-6b220b03555171c1d2d9666a79391542d989b280.tar.gz cpython-6b220b03555171c1d2d9666a79391542d989b280.tar.bz2 |
Use os.geteuid() for checking whether we are root, as suggested by
Michael Hudson.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index c28e5a3..7c28602 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -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) |