summaryrefslogtreecommitdiff
path: root/Lib/lib2to3/main.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-11-25 18:16:46 +0000
committerBenjamin Peterson <benjamin@python.org>2009-11-25 18:16:46 +0000
commit42d26d94cc5fe633613c853c1e1b4b51f0855df4 (patch)
treebef533daf1fbecdc6f9d7818123ad8b7f16897e7 /Lib/lib2to3/main.py
parent2ed8813f227756a8a698b03f1eb0b98af0b2b8b6 (diff)
downloadcpython-git-42d26d94cc5fe633613c853c1e1b4b51f0855df4.tar.gz
Merged revisions 76160-76161,76250,76252,76447,76506 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r76160 | benjamin.peterson | 2009-11-08 18:53:48 -0600 (Sun, 08 Nov 2009) | 1 line undeprecate the -p option; it's useful for converting python3 sources ........ r76161 | benjamin.peterson | 2009-11-08 19:05:37 -0600 (Sun, 08 Nov 2009) | 1 line simplify condition ........ r76250 | benjamin.peterson | 2009-11-13 16:56:48 -0600 (Fri, 13 Nov 2009) | 1 line fix handling of a utf-8 bom #7313 ........ r76252 | benjamin.peterson | 2009-11-13 16:58:36 -0600 (Fri, 13 Nov 2009) | 1 line remove pdb turd ........ r76447 | benjamin.peterson | 2009-11-22 18:17:40 -0600 (Sun, 22 Nov 2009) | 1 line #7375 fix nested transformations in fix_urllib ........ r76506 | benjamin.peterson | 2009-11-24 18:34:31 -0600 (Tue, 24 Nov 2009) | 1 line use generator expressions in any() ........
Diffstat (limited to 'Lib/lib2to3/main.py')
-rw-r--r--Lib/lib2to3/main.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index 92388079b2..736d5a6bd1 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -91,8 +91,7 @@ def main(fixer_pkg, args=None):
parser.add_option("-l", "--list-fixes", action="store_true",
help="List available transformations (fixes/fix_*.py)")
parser.add_option("-p", "--print-function", action="store_true",
- help="DEPRECATED Modify the grammar so that print() is "
- "a function")
+ help="Modify the grammar so that print() is a function")
parser.add_option("-v", "--verbose", action="store_true",
help="More verbose logging")
parser.add_option("--no-diffs", action="store_true",
@@ -104,12 +103,10 @@ def main(fixer_pkg, args=None):
# Parse command line arguments
refactor_stdin = False
+ flags = {}
options, args = parser.parse_args(args)
if not options.write and options.no_diffs:
warn("not writing files and not printing diffs; that's not very useful")
- if options.print_function:
- warn("-p is deprecated; "
- "detection of from __future__ import print_function is automatic")
if not options.write and options.nobackups:
parser.error("Can't use -n without -w")
if options.list_fixes:
@@ -127,6 +124,8 @@ def main(fixer_pkg, args=None):
if options.write:
print >> sys.stderr, "Can't write to stdin."
return 2
+ if options.print_function:
+ flags["print_function"] = True
# Set up logging handler
level = logging.DEBUG if options.verbose else logging.INFO
@@ -147,7 +146,7 @@ def main(fixer_pkg, args=None):
else:
requested = avail_fixes.union(explicit)
fixer_names = requested.difference(unwanted_fixes)
- rt = StdoutRefactoringTool(sorted(fixer_names), None, sorted(explicit),
+ rt = StdoutRefactoringTool(sorted(fixer_names), flags, sorted(explicit),
options.nobackups, not options.no_diffs)
# Refactor all files and directories passed as arguments