mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #7071: byte-compilation in Distutils now looks at sys.dont_write_bytecode
This commit is contained in:
parent
da8652d920
commit
b9c1cfc428
8 changed files with 67 additions and 5 deletions
|
@ -89,6 +89,22 @@ class BuildPyTestCase(support.TempdirManager,
|
|||
os.chdir(cwd)
|
||||
sys.stdout = sys.__stdout__
|
||||
|
||||
def test_dont_write_bytecode(self):
|
||||
# makes sure byte_compile is not used
|
||||
pkg_dir, dist = self.create_dist()
|
||||
cmd = build_py(dist)
|
||||
cmd.compile = 1
|
||||
cmd.optimize = 1
|
||||
|
||||
old_dont_write_bytecode = sys.dont_write_bytecode
|
||||
sys.dont_write_bytecode = True
|
||||
try:
|
||||
cmd.byte_compile([])
|
||||
finally:
|
||||
sys.dont_write_bytecode = old_dont_write_bytecode
|
||||
|
||||
self.assertTrue('byte-compile not supported ' in self.logs[0][1])
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(BuildPyTestCase)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue