mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
42b334d93d
commit
a74c55662f
|
@ -4,10 +4,11 @@
|
||||||
|
|
||||||
# Released to the public domain, by Tim Peters, 15 April 1998.
|
# Released to the public domain, by Tim Peters, 15 April 1998.
|
||||||
|
|
||||||
__version__ = "5"
|
__version__ = "6"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import string
|
||||||
import getopt
|
import getopt
|
||||||
import tokenize
|
import tokenize
|
||||||
|
|
||||||
|
@ -88,6 +89,7 @@ def check(file):
|
||||||
print "offending line:", `line`
|
print "offending line:", `line`
|
||||||
print nag.get_msg()
|
print nag.get_msg()
|
||||||
else:
|
else:
|
||||||
|
if ' ' in file: file = '"' + file + '"'
|
||||||
if filename_only: print file
|
if filename_only: print file
|
||||||
else: print file, badline, `line`
|
else: print file, badline, `line`
|
||||||
return
|
return
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
|
|
||||||
# Released to the public domain, by Tim Peters, 15 April 1998.
|
# Released to the public domain, by Tim Peters, 15 April 1998.
|
||||||
|
|
||||||
__version__ = "5"
|
__version__ = "6"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import string
|
||||||
import getopt
|
import getopt
|
||||||
import tokenize
|
import tokenize
|
||||||
|
|
||||||
|
@ -88,6 +89,7 @@ def check(file):
|
||||||
print "offending line:", `line`
|
print "offending line:", `line`
|
||||||
print nag.get_msg()
|
print nag.get_msg()
|
||||||
else:
|
else:
|
||||||
|
if ' ' in file: file = '"' + file + '"'
|
||||||
if filename_only: print file
|
if filename_only: print file
|
||||||
else: print file, badline, `line`
|
else: print file, badline, `line`
|
||||||
return
|
return
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
|
|
||||||
# Released to the public domain, by Tim Peters, 15 April 1998.
|
# Released to the public domain, by Tim Peters, 15 April 1998.
|
||||||
|
|
||||||
__version__ = "5"
|
__version__ = "6"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import string
|
||||||
import getopt
|
import getopt
|
||||||
import tokenize
|
import tokenize
|
||||||
|
|
||||||
|
@ -88,6 +89,7 @@ def check(file):
|
||||||
print "offending line:", `line`
|
print "offending line:", `line`
|
||||||
print nag.get_msg()
|
print nag.get_msg()
|
||||||
else:
|
else:
|
||||||
|
if ' ' in file: file = '"' + file + '"'
|
||||||
if filename_only: print file
|
if filename_only: print file
|
||||||
else: print file, badline, `line`
|
else: print file, badline, `line`
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue