]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Mark Hammond writes:
authorGuido van Rossum <guido@python.org>
Fri, 30 Jul 1999 17:48:20 +0000 (17:48 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 30 Jul 1999 17:48:20 +0000 (17:48 +0000)
"""
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.

Lib/tabnanny.py
Tools/idle/tabnanny.py
Tools/scripts/tabnanny.py

index f68ed2da40f7d0255d31540cd6421765fae65a8d..c5adfb50085b10c712091c90262e846fd0da9910 100755 (executable)
@@ -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
index f68ed2da40f7d0255d31540cd6421765fae65a8d..c5adfb50085b10c712091c90262e846fd0da9910 100755 (executable)
@@ -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
index f68ed2da40f7d0255d31540cd6421765fae65a8d..c5adfb50085b10c712091c90262e846fd0da9910 100755 (executable)
@@ -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