##// END OF EJS Templates
Make raise statements Python 3 compatible....
Thomas Kluyver -
Show More
@@ -280,8 +280,7 b' class FileLink(object):'
280 text to append at the end of link [default: '<br>']
280 text to append at the end of link [default: '<br>']
281 """
281 """
282 if isdir(path):
282 if isdir(path):
283 raise ValueError,\
283 raise ValueError("Cannot display a directory using FileLink. "
284 ("Cannot display a directory using FileLink. "
285 "Use FileLinks to display '%s'." % path)
284 "Use FileLinks to display '%s'." % path)
286 self.path = path
285 self.path = path
287 self.url_prefix = url_prefix
286 self.url_prefix = url_prefix
@@ -366,8 +365,7 b' class FileLinks(FileLink):'
366
365
367 """
366 """
368 if isfile(path):
367 if isfile(path):
369 raise ValueError,\
368 raise ValueError("Cannot display a file using FileLinks. "
370 ("Cannot display a file using FileLinks. "
371 "Use FileLink to display '%s'." % path)
369 "Use FileLink to display '%s'." % path)
372 self.included_suffixes = included_suffixes
370 self.included_suffixes = included_suffixes
373 # remove trailing slashs for more consistent output formatting
371 # remove trailing slashs for more consistent output formatting
@@ -308,7 +308,7 b' def generate_tokens(readline):'
308
308
309 if contstr: # continued string
309 if contstr: # continued string
310 if not line:
310 if not line:
311 raise TokenError, ("EOF in multi-line string", strstart)
311 raise TokenError("EOF in multi-line string", strstart)
312 endmatch = endprog.match(line)
312 endmatch = endprog.match(line)
313 if endmatch:
313 if endmatch:
314 pos = end = endmatch.end(0)
314 pos = end = endmatch.end(0)
@@ -369,7 +369,7 b' def generate_tokens(readline):'
369
369
370 else: # continued statement
370 else: # continued statement
371 if not line:
371 if not line:
372 raise TokenError, ("EOF in multi-line statement", (lnum, 0))
372 raise TokenError("EOF in multi-line statement", (lnum, 0))
373 continued = 0
373 continued = 0
374
374
375 while pos < max:
375 while pos < max:
General Comments 0
You need to be logged in to leave comments. Login now