]> granicus.if.org Git - python/commitdiff
Make test_compileall more robust by using -S to keep sys.path minimized.
authorR. David Murray <rdmurray@bitdance.com>
Mon, 20 Dec 2010 18:08:59 +0000 (18:08 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Mon, 20 Dec 2010 18:08:59 +0000 (18:08 +0000)
Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo
install because it was tyring to write .pyc files to a read-only system
directory during test_no_args_compiles_path.  Having subprocess call python
with -S should eliminate the system directories from the path.

Lib/test/test_compileall.py

index 3f333a58dbffced51f860face524c72a078fdb8c..f8b4e46f1f9d07d8e3cbd9105d8f749f4faa27ae 100644 (file)
@@ -132,7 +132,7 @@ class CommandLineTests(unittest.TestCase):
 
     def assertRunNotOK(self, *args, **env_vars):
         rc, out, err = script_helper.assert_python_failure(
-                         '-m', 'compileall', *args, **env_vars)
+                         '-S', '-m', 'compileall', *args, **env_vars)
         return rc, out, err
 
     def assertCompiled(self, fn):