summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-07-09 13:55:44 +0000
committerR. David Murray <rdmurray@bitdance.com>2009-07-09 13:55:44 +0000
commitfbf2cc4d7467a489ef8948f7461c9f30c900eee5 (patch)
tree7a3a93b58449ccd0c9eb4bd0f29ef52544b2838c
parent00490f2754a4993c55d52f1612535964409d3cf1 (diff)
downloadcpython-git-fbf2cc4d7467a489ef8948f7461c9f30c900eee5.tar.gz
Specify umask in execute bit test to get consistent results
and make sure we test resetting all three execute bits.
-rw-r--r--Lib/test/test_import.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 0c4fd87ac8..64cc3141e7 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -97,6 +97,7 @@ class ImportTest(unittest.TestCase):
def test_execute_bit_not_copied(self):
# Issue 6070: under posix .pyc files got their execute bit set if
# the .py file had the execute bit set, but they aren't executable.
+ oldmask = os.umask(022)
try:
fname = TESTFN + os.extsep + "py"
f = open(fname, 'w').close()
@@ -112,6 +113,7 @@ class ImportTest(unittest.TestCase):
self.assertEquals(stat.S_IMODE(s.st_mode),
stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
finally:
+ os.umask(oldmask)
remove_files(TESTFN)
if TESTFN in sys.modules: del sys.modules[TESTFN]