summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2010-01-08 23:27:23 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2010-01-08 23:27:23 (GMT)
commitf9983415722d1beafc1845c17be2d851637b5397 (patch)
tree09932b93bf4b3c1f7edf5686a80ea95edca654b1 /Lib/distutils/util.py
parent0b074575b737ee31a46c05718110272c2785e47a (diff)
downloadcpython-f9983415722d1beafc1845c17be2d851637b5397.zip
cpython-f9983415722d1beafc1845c17be2d851637b5397.tar.gz
cpython-f9983415722d1beafc1845c17be2d851637b5397.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.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index d314961..36ac721 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -11,6 +11,7 @@ from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distutils import log
+from distutils.errors import DistutilsByteCompileError
def get_platform ():
"""Return a string that identifies the current platform. This is used
@@ -457,6 +458,9 @@ def byte_compile (py_files,
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