Issue #10639: spec_newline wasn't defined globally unless main() was called; now spec_newline is set at module import/execution

This commit is contained in:
Jason R. Coombs 2011-07-29 09:31:56 -04:00
parent 76eec3db21
commit 47891044c9
1 changed files with 2 additions and 2 deletions

View File

@ -52,6 +52,8 @@ verbose = False
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 @@ def errprint(*args):
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"])