[Python-checkins] r88503 - in python/branches/py3k: Lib/lib2to3/__main__.py Tools/scripts/2to3
brett.cannon
python-checkins at python.org
Tue Feb 22 20:12:43 CET 2011
Author: brett.cannon
Date: Tue Feb 22 20:12:43 2011
New Revision: 88503
Log:
Add lib2to3.__main__ to make it easier for debugging purposes to run 2to3.
Added:
python/branches/py3k/Lib/lib2to3/__main__.py
Modified:
python/branches/py3k/Tools/scripts/2to3
Added: python/branches/py3k/Lib/lib2to3/__main__.py
==============================================================================
--- (empty file)
+++ python/branches/py3k/Lib/lib2to3/__main__.py Tue Feb 22 20:12:43 2011
@@ -0,0 +1,4 @@
+import sys
+from .main import main
+
+sys.exit(main("lib2to3.fixes"))
Modified: python/branches/py3k/Tools/scripts/2to3
==============================================================================
--- python/branches/py3k/Tools/scripts/2to3 (original)
+++ python/branches/py3k/Tools/scripts/2to3 Tue Feb 22 20:12:43 2011
@@ -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)
More information about the Python-checkins
mailing list