diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-25 23:08:47 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-25 23:08:47 (GMT) |
commit | 04fe7c01a8a0dd8a7234dd0f527e22386c2fed04 (patch) | |
tree | f4227e1b677431d14f9d8757e6ade6d858f422cc /Lib/distutils/util.py | |
parent | 4824c25e756280b13705c00fd56cb307e5a44cc7 (diff) | |
download | cpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.zip cpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.tar.gz cpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.tar.bz2 |
Merged revisions 75669-75671 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75669 | tarek.ziade | 2009-10-24 17:10:37 +0200 (Sat, 24 Oct 2009) | 1 line
Issue #7071: byte-compilation in Distutils now looks at sys.dont_write_bytecode
........
r75670 | tarek.ziade | 2009-10-24 17:19:03 +0200 (Sat, 24 Oct 2009) | 1 line
fixed finally state in distutils.test_util
........
r75671 | tarek.ziade | 2009-10-24 17:51:30 +0200 (Sat, 24 Oct 2009) | 1 line
fixed warning and error message
........
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 6709bbf..a50621e 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -13,6 +13,7 @@ from distutils.dep_util import newer from distutils.spawn import spawn, find_executable from distutils import log from distutils.version import LooseVersion +from distutils.errors import DistutilsByteCompileError def get_platform(): """Return a string that identifies the current platform. @@ -444,6 +445,10 @@ def byte_compile(py_files, optimize=0, force=0, prefix=None, base_dir=None, generated in indirect mode; unless you know what you're doing, leave it set to None. """ + # nothing is done if sys.dont_write_bytecode is True + if sys.dont_write_bytecode: + raise DistutilsByteCompileError('byte-compiling is disabled.') + # First, if the caller didn't force us into direct or indirect mode, # figure out which mode we should be in. We take a conservative # approach: choose direct mode *only* if the current interpreter is |