diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-10 23:29:37 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-10 23:29:37 +0200 |
commit | dc27d10f10fe3ade2f957ca1ac10257d382c1a5c (patch) | |
tree | bb63db9f0bc39710914e022a7e4733dab0618ba5 | |
parent | 713b6d60546336beb2e426b2f8e6825e417f0e14 (diff) | |
download | pep8-dc27d10f10fe3ade2f957ca1ac10257d382c1a5c.tar.gz |
Only 'options' is a global variable.
-rwxr-xr-x | pep8.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -158,7 +158,6 @@ SKIP_TOKENS = frozenset([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE, BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] options = None -args = None ############################################################################## @@ -1396,7 +1395,7 @@ class Checker(object): print(options.format % { 'path': self.filename, 'row': self.line_offset + line_number, 'col': offset + 1, - 'code': code, 'text': text[4:].lstrip(), + 'code': code, 'text': text[5:], }) if options.show_source: if line_number > len(self.lines): @@ -1697,7 +1696,6 @@ def process_options(arglist=None): """ Process options passed either via arglist or via command line args. """ - global options, args parser = OptionParser(version=__version__, usage="%prog [options] input ...") parser.add_option('-v', '--verbose', default=0, action='count', @@ -1794,6 +1792,7 @@ def _main(): """ Parse options and run checks on Python source. """ + global options options, args = process_options() count_failed = 0 if options.doctest: |