Invoke byte-compilation after running 2to3.

This commit is contained in:
Martin v. Löwis 2008-03-22 22:07:43 +00:00
parent 5021ebc892
commit 84f4dfd3f6
1 changed files with 13 additions and 2 deletions

View File

@ -386,9 +386,17 @@ class build_py (Command):
class build_py_2to3(build_py):
def run(self):
from lib2to3.refactor import RefactoringTool
self.updated_files = []
build_py.run(self)
# Base class code
if self.py_modules:
self.build_modules()
if self.packages:
self.build_packages()
self.build_package_data()
# 2to3
from lib2to3.refactor import RefactoringTool
class Options:
pass
o = Options()
@ -401,6 +409,9 @@ class build_py_2to3(build_py):
r = RefactoringTool(o)
r.refactor_args(self.updated_files)
# Remaining base class code
self.byte_compile(self.get_outputs(include_bytecode=0))
def build_module(self, module, module_file, package):
res = build_py.build_module(self, module, module_file, package)
if res[1]: