Skip to content

Commit 4cfa247

Browse files
committed
Add lib2to3.__main__ to make it easier for debugging purposes to run 2to3.
1 parent bd258bd commit 4cfa247

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/lib2to3/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import sys
2+
from .main import main
3+
4+
sys.exit(main("lib2to3.fixes"))

Tools/scripts/2to3

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
import sys
3-
from lib2to3.main import main
2+
import runpy
43

5-
sys.exit(main("lib2to3.fixes"))
4+
runpy.run_module('lib2to3', run_name='__main__', alter_sys=True)

0 commit comments

Comments
 (0)