diff options
author | Brian May <brian@linuxpenguins.xyz> | 2018-06-18 17:11:31 +1000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2018-07-13 15:15:20 +1000 |
commit | cc04ebb4f6ebbf80080b7990d710a55fd55a19a2 (patch) | |
tree | ea5ffabe533be6124b9c30bc82af3e23d08f10dc /lib/python/web_support.py | |
parent | 9889b3ebf70085d28f84371a931adcced2ff19fd (diff) |
Update python exception syntax for Python 3.6 compatibility
Diffstat (limited to 'lib/python/web_support.py')
-rw-r--r-- | lib/python/web_support.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py index c28452d5a0..1e204d06bc 100644 --- a/lib/python/web_support.py +++ b/lib/python/web_support.py @@ -320,7 +320,7 @@ class Tag(HTMLBase): if self.re_name.match(name): return else: - raise ValueError, "invalid name: " + `name` + raise ValueError("invalid name: " + repr(name)) def flatten(self, write): if self.contents: @@ -552,13 +552,13 @@ class PathRouter: else: if element == '*': if x + 1 <> len(p): - raise ValueError, 'wildcard * in the middle of path' + raise ValueError('wildcard * in the middle of path') m['*'] = value return if element == '**': if x + 1 <> len(p): - raise ValueError, \ - 'wildcard ** in the middle of path' + raise ValueError( + 'wildcard ** in the middle of path') m['**'] = value return @@ -566,7 +566,7 @@ class PathRouter: m[element] = m_new m = m_new else: - raise ValueError, "path contains empty element" + raise ValueError("path contains empty element") m[''] = value def get(self, path): @@ -592,7 +592,7 @@ class PathRouter: return (m['*'], tuple(p[x:])) if m.has_key('**'): return (m['**'], tuple(p[x:])) - raise InvalidPath + raise InvalidPath() try: result = m[''] except KeyError: @@ -601,7 +601,7 @@ class PathRouter: elif m.has_key('**'): result = m['**'] else: - raise InvalidPath + raise InvalidPath() return (result, ()) class Result(object): |