Convert raise statements in Tools/.

This commit is contained in:
Collin Winter 2007-08-22 23:05:06 +00:00
parent 2d7f6a079d
commit a817e5894b
16 changed files with 29 additions and 29 deletions

View file

@ -257,7 +257,7 @@ class TexinfoParser:
line = fp.readline()
lineno = lineno + 1
if line[:len(MAGIC)] <> MAGIC:
raise SyntaxError, 'file does not begin with %r' % (MAGIC,)
raise SyntaxError('file does not begin with %r' % (MAGIC,))
self.parserest(fp, lineno)
# Parse the contents of a file, not expecting a MAGIC header
@ -475,7 +475,7 @@ class TexinfoParser:
continue
if c <> '@':
# Cannot happen unless spprog is changed
raise RuntimeError, 'unexpected funny %r' % c
raise RuntimeError('unexpected funny %r' % c)
start = i
while i < n and text[i] in string.ascii_letters: i = i+1
if i == start:

View file

@ -11,7 +11,7 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "t:")
if not args:
raise getopt.error, "At least one file argument required"
raise getopt.error("At least one file argument required")
except getopt.error as msg:
print(msg)
print("usage:", sys.argv[0], "[-t tabwidth] file ...")