mirror of
https://github.com/python/cpython
synced 2024-09-04 15:56:13 +00:00
Invoke byte-compilation after running 2to3.
This commit is contained in:
parent
5021ebc892
commit
84f4dfd3f6
|
@ -386,9 +386,17 @@ def byte_compile(self, files):
|
|||
|
||||
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 Options:
|
|||
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]:
|
||||
|
|
Loading…
Reference in a new issue