Commit dcf37973 authored by Martin v. Löwis's avatar Martin v. Löwis

Add build_py_2to3.

parent 227cb3d3
......@@ -383,3 +383,27 @@ class build_py (Command):
if self.optimize > 0:
byte_compile(files, optimize=self.optimize,
force=self.force, prefix=prefix, dry_run=self.dry_run)
class build_py_2to3(build_py):
def run(self):
from lib2to3.refactor import RefactoringTool
self.updated_files = []
build_py.run(self)
class Options:
pass
o = Options()
o.doctests_only = False
o.fix = []
o.list_fixes = []
o.print_function = False
o.verbose = False
o.write = True
r = RefactoringTool(o)
r.refactor_args(self.updated_files)
def build_module(self, module, module_file, package):
res = build_py.build_module(self, module, module_file, package)
if res[1]:
# file was copied
self.updated_files.append(res[0])
return res
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment