diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:40 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:40 +0100 |
commit | 9b529a23f64c4b27c427a2680428f3e17531e9c3 (patch) | |
tree | 6647b5b6639201d2a18767b6fa4c3f73a36be61b /paste/util | |
parent | 52ecfe48860ed04a80532fd7a01b51fbed9c7217 (diff) | |
download | paste-9b529a23f64c4b27c427a2680428f3e17531e9c3.tar.gz |
Python 3: use new style of raise, replace "raise class, args" with "raise class(args)"
Diffstat (limited to 'paste/util')
-rw-r--r-- | paste/util/PySourceColor.py | 10 | ||||
-rw-r--r-- | paste/util/multidict.py | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/paste/util/PySourceColor.py b/paste/util/PySourceColor.py index c2a9363..35efc7f 100644 --- a/paste/util/PySourceColor.py +++ b/paste/util/PySourceColor.py @@ -750,11 +750,11 @@ def cli(): linenumbers=linenumbers, header=header,
footer=footer, form=form)
else:
- raise PathError, 'File does not exists!'
+ raise PathError('File does not exists!')
else:
try:
if sys.stdin.isatty():
- raise InputError, 'Please check input!'
+ raise InputError('Please check input!')
else:
if output in [None,"-","stdout"]:
str2stdout(sys.stdin.read(), colors=colorscheme,
@@ -780,7 +780,7 @@ def cli(): show=show, markup=markup, quiet=quiet, header=header,
footer=footer, linenumbers=linenumbers, form=form)
else:
- raise PathError, 'File does not exists!'
+ raise PathError('File does not exists!')
Usage()
######################################################### Simple markup tests
@@ -1009,7 +1009,7 @@ def convert(source, outdir=None, colors=None, path2file(source, outdir, colors, show, markup,
quiet, form, header, footer, linenumbers, count)
else:
- raise PathError, 'File does not exist!'
+ raise PathError('File does not exist!')
# If we pass in a dir we need to walkdir for files.
# Then we need to colorize them with path2file
else:
@@ -1095,7 +1095,7 @@ def tagreplace(sourcestr, colors=lite, markup='xhtml', end = sourcestr[dataend+len(tagend):]
sourcestr = ''.join([start,data,end])
else:
- raise InputError,'Tag mismatch!\nCheck %s,%s tags'%tagstart,tagend
+ raise InputError('Tag mismatch!\nCheck %s,%s tags'%tagstart,tagend)
if not dosheet:
css = None
return css, sourcestr
diff --git a/paste/util/multidict.py b/paste/util/multidict.py index 867f309..d81cce0 100644 --- a/paste/util/multidict.py +++ b/paste/util/multidict.py @@ -145,8 +145,8 @@ class MultiDict(DictMixin): def pop(self, key, *args): if len(args) > 1: - raise TypeError, "pop expected at most 2 arguments, got "\ - + repr(1 + len(args)) + raise TypeError("pop expected at most 2 arguments, got " + + repr(1 + len(args))) for i in range(len(self._items)): if self._items[i][0] == key: v = self._items[i][1] |