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()
........
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index 9238807..736d5a6 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -91,8 +91,7 @@
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 @@
# 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 @@
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 @@
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