diff options
| author | Guido van Rossum <guido@python.org> | 1999-07-30 17:48:20 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1999-07-30 17:48:20 +0000 |
| commit | a74c55662f2719dda984cdaa42dbb15772c0420f (patch) | |
| tree | 2054a805d2d33413012ff42906a7bf18168dd690 | |
| parent | 42b334d93d0454f12eb249805049b75d2bd6dc07 (diff) | |
| download | cpython-git-a74c55662f2719dda984cdaa42dbb15772c0420f.tar.gz | |
Mark Hammond writes:
"""
If the filename being complained about contains a space, enclose the
file-name in quotes.
The reason is simply that when I try and parse tabnanny's output, filenames
with spaces make it very difficult to determine where the filename stops
and the linenumber begins!
"""
Tim approves.
I slightly changed the patch (use 'in' instead of string.find()) and
arbitrarily bumped the __version__ variable up to 6.
| -rwxr-xr-x | Lib/tabnanny.py | 4 | ||||
| -rwxr-xr-x | Tools/idle/tabnanny.py | 4 | ||||
| -rwxr-xr-x | Tools/scripts/tabnanny.py | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index f68ed2da40..c5adfb5008 100755 --- a/Lib/tabnanny.py +++ b/Lib/tabnanny.py @@ -4,10 +4,11 @@ # Released to the public domain, by Tim Peters, 15 April 1998. -__version__ = "5" +__version__ = "6" import os import sys +import string import getopt import tokenize @@ -88,6 +89,7 @@ def check(file): print "offending line:", `line` print nag.get_msg() else: + if ' ' in file: file = '"' + file + '"' if filename_only: print file else: print file, badline, `line` return diff --git a/Tools/idle/tabnanny.py b/Tools/idle/tabnanny.py index f68ed2da40..c5adfb5008 100755 --- a/Tools/idle/tabnanny.py +++ b/Tools/idle/tabnanny.py @@ -4,10 +4,11 @@ # Released to the public domain, by Tim Peters, 15 April 1998. -__version__ = "5" +__version__ = "6" import os import sys +import string import getopt import tokenize @@ -88,6 +89,7 @@ def check(file): print "offending line:", `line` print nag.get_msg() else: + if ' ' in file: file = '"' + file + '"' if filename_only: print file else: print file, badline, `line` return diff --git a/Tools/scripts/tabnanny.py b/Tools/scripts/tabnanny.py index f68ed2da40..c5adfb5008 100755 --- a/Tools/scripts/tabnanny.py +++ b/Tools/scripts/tabnanny.py @@ -4,10 +4,11 @@ # Released to the public domain, by Tim Peters, 15 April 1998. -__version__ = "5" +__version__ = "6" import os import sys +import string import getopt import tokenize @@ -88,6 +89,7 @@ def check(file): print "offending line:", `line` print nag.get_msg() else: + if ' ' in file: file = '"' + file + '"' if filename_only: print file else: print file, badline, `line` return |
