From: Johannes Gijsbers Date: Mon, 6 Dec 2004 21:22:17 +0000 (+0000) Subject: Backport of fix for SF bug #1076467: don't run test_on_error as root, as X-Git-Tag: v2.4.1c1~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82ced1139a141fc7b07af668cf53ea7a0eb966a7;p=thirdparty%2FPython%2Fcpython.git Backport of fix for SF bug #1076467: don't run test_on_error as root, as the permission errors don't get provoked that way. --- diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 1db3fc527e4e..0f78ddc5c0df 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -16,7 +16,8 @@ class TestShutil(unittest.TestCase): filename = tempfile.mktemp() self.assertRaises(OSError, shutil.rmtree, filename) - if hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin': + if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin' + and os.getenv('USER') != 'root'): def test_on_error(self): self.errorState = 0 os.mkdir(TESTFN)