From 4cfa24757b2f0946994aaa96ca5e135d30b49de3 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 22 Feb 2011 19:12:43 +0000 Subject: [PATCH] Add lib2to3.__main__ to make it easier for debugging purposes to run 2to3. --- Lib/lib2to3/__main__.py | 4 ++++ Tools/scripts/2to3 | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 Lib/lib2to3/__main__.py diff --git a/Lib/lib2to3/__main__.py b/Lib/lib2to3/__main__.py new file mode 100644 index 00000000000..80688baf27a --- /dev/null +++ b/Lib/lib2to3/__main__.py @@ -0,0 +1,4 @@ +import sys +from .main import main + +sys.exit(main("lib2to3.fixes")) diff --git a/Tools/scripts/2to3 b/Tools/scripts/2to3 index fbd4aa6b838..2eb5dad00a4 100755 --- a/Tools/scripts/2to3 +++ b/Tools/scripts/2to3 @@ -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)