cpython: Issue #10639: spec_newline wasn't defined globally unless main() was called;

http://hg.python.org/cpython/rev/2547f7965733 changeset: 71596:2547f7965733 parent: 71506:4feb889d3bed user: Jason R. Coombs <jaraco@jaraco.com> date: Fri Jul 29 09:31:56 2011 -0400 summary: Issue #10639: spec_newline wasn't defined globally unless main() was called; now spec_newline is set at module import/execution files: Tools/scripts/reindent.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py --- a/Tools/scripts/reindent.py +++ b/Tools/scripts/reindent.py @@ -52,6 +52,8 @@ recurse = False dryrun = False makebackup = True +"A specified newline to be used in the output (set by --newline option)" +spec_newline = None def usage(msg=None): @@ -64,11 +66,9 @@ sys.stderr.write(" ".join(str(arg) for arg in args)) sys.stderr.write("\n") - def main(): import getopt global verbose, recurse, dryrun, makebackup, spec_newline - spec_newline = None try: opts, args = getopt.getopt(sys.argv[1:], "drnvh", ["dryrun", "recurse", "nobackup", "verbose", "newline=", "help"]) -- Repository URL: http://hg.python.org/cpython
participants (1)
-
jason.coombs