diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 0670e09..1144230 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -280,8 +280,7 @@ class FileLink(object): text to append at the end of link [default: '
'] """ if isdir(path): - raise ValueError,\ - ("Cannot display a directory using FileLink. " + raise ValueError("Cannot display a directory using FileLink. " "Use FileLinks to display '%s'." % path) self.path = path self.url_prefix = url_prefix @@ -366,8 +365,7 @@ class FileLinks(FileLink): """ if isfile(path): - raise ValueError,\ - ("Cannot display a file using FileLinks. " + raise ValueError("Cannot display a file using FileLinks. " "Use FileLink to display '%s'." % path) self.included_suffixes = included_suffixes # remove trailing slashs for more consistent output formatting diff --git a/IPython/utils/_tokenize_py2.py b/IPython/utils/_tokenize_py2.py index fcce39c..195df96 100644 --- a/IPython/utils/_tokenize_py2.py +++ b/IPython/utils/_tokenize_py2.py @@ -308,7 +308,7 @@ def generate_tokens(readline): if contstr: # continued string if not line: - raise TokenError, ("EOF in multi-line string", strstart) + raise TokenError("EOF in multi-line string", strstart) endmatch = endprog.match(line) if endmatch: pos = end = endmatch.end(0) @@ -369,7 +369,7 @@ def generate_tokens(readline): else: # continued statement if not line: - raise TokenError, ("EOF in multi-line statement", (lnum, 0)) + raise TokenError("EOF in multi-line statement", (lnum, 0)) continued = 0 while pos < max: