]> granicus.if.org Git - python/commitdiff
Add lib2to3.__main__ to make it easier for debugging purposes to run 2to3.
authorBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 19:12:43 +0000 (19:12 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 19:12:43 +0000 (19:12 +0000)
Lib/lib2to3/__main__.py [new file with mode: 0644]
Tools/scripts/2to3

diff --git a/Lib/lib2to3/__main__.py b/Lib/lib2to3/__main__.py
new file mode 100644 (file)
index 0000000..80688ba
--- /dev/null
@@ -0,0 +1,4 @@
+import sys
+from .main import main
+
+sys.exit(main("lib2to3.fixes"))
index fbd4aa6b838234014af3619fd3f4d8d9c999025d..2eb5dad00a40c7663ac7fcfd9c99fd5b44c3a813 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
-import sys
-from lib2to3.main import main
+import runpy
 
-sys.exit(main("lib2to3.fixes"))
+runpy.run_module('lib2to3', run_name='__main__', alter_sys=True)