summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2011-07-29 13:31:56 (GMT)
committerJason R. Coombs <jaraco@jaraco.com>2011-07-29 13:31:56 (GMT)
commit47891044c9422adce3658182d0acd608d9d3c3d6 (patch)
treefe833a809f5ad2d333ff641fc57c2af0c8bcb066
parent76eec3db2173079ce103fbd3ac53892ddec8b963 (diff)
downloadcpython-47891044c9422adce3658182d0acd608d9d3c3d6.zip
cpython-47891044c9422adce3658182d0acd608d9d3c3d6.tar.gz
cpython-47891044c9422adce3658182d0acd608d9d3c3d6.tar.bz2
Issue #10639: spec_newline wasn't defined globally unless main() was called; now spec_newline is set at module import/execution
-rwxr-xr-xTools/scripts/reindent.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py
index ed66bc1..89b5e23 100755
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -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"])