mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Convert raise statements in Tools/.
This commit is contained in:
parent
2d7f6a079d
commit
a817e5894b
16 changed files with 29 additions and 29 deletions
|
@ -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:
|
||||
|
|
|
@ -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 ...")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue