summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/build_py.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 15:10:37 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 15:10:37 (GMT)
commitb9c1cfc42881370322ff6894568b45dcfec5ba2e (patch)
tree590778ae7770d5c8dcdfbffc7f77c8b91ccd4c30 /Lib/distutils/command/build_py.py
parentda8652d920210a5ff783a7ad30f4c24d2b5ff2a2 (diff)
downloadcpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.zip
cpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.tar.gz
cpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.tar.bz2
Issue #7071: byte-compilation in Distutils now looks at sys.dont_write_bytecode
Diffstat (limited to 'Lib/distutils/command/build_py.py')
-rw-r--r--Lib/distutils/command/build_py.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
index 5d249f3..9b9f551 100644
--- a/Lib/distutils/command/build_py.py
+++ b/Lib/distutils/command/build_py.py
@@ -5,6 +5,7 @@ Implements the Distutils 'build_py' command."""
__revision__ = "$Id$"
import os
+import sys
from glob import glob
from distutils.core import Command
@@ -372,6 +373,10 @@ class build_py(Command):
self.build_module(module, module_file, package)
def byte_compile(self, files):
+ if sys.dont_write_bytecode:
+ self.warn('byte-compile not supported on this platform, skipping.')
+ return
+
from distutils.util import byte_compile
prefix = self.build_lib
if prefix[-1] != os.sep: