summaryrefslogtreecommitdiffstats
path: root/lib/python/sectracker
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2018-06-18 17:11:31 +1000
committerBrian May <brian@linuxpenguins.xyz>2018-07-13 15:15:20 +1000
commitcc04ebb4f6ebbf80080b7990d710a55fd55a19a2 (patch)
treeea5ffabe533be6124b9c30bc82af3e23d08f10dc /lib/python/sectracker
parent9889b3ebf70085d28f84371a931adcced2ff19fd (diff)
Update python exception syntax for Python 3.6 compatibility
Diffstat (limited to 'lib/python/sectracker')
-rw-r--r--lib/python/sectracker/regexpcase.py2
-rw-r--r--lib/python/sectracker/xcollections.py2
-rw-r--r--lib/python/sectracker/xpickle.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/sectracker/regexpcase.py b/lib/python/sectracker/regexpcase.py
index 47849686cb..f77d672770 100644
--- a/lib/python/sectracker/regexpcase.py
+++ b/lib/python/sectracker/regexpcase.py
@@ -74,7 +74,7 @@ class RegexpCase(object):
def __call__(self, key, *args):
if not self.maycall:
- raise TypeError, "not all actions are callable"
+ raise TypeError("not all actions are callable")
(groups, action) = self.match(key)
if action is None:
return None
diff --git a/lib/python/sectracker/xcollections.py b/lib/python/sectracker/xcollections.py
index cf7528ad5b..4dbf38010e 100644
--- a/lib/python/sectracker/xcollections.py
+++ b/lib/python/sectracker/xcollections.py
@@ -80,7 +80,7 @@ def namedtuple(typename, field_names, verbose=False):
_property=property, _tuple=tuple)
try:
exec template in namespace
- except SyntaxError, e:
+ except SyntaxError as e:
raise SyntaxError(e.message + ':\n' + template)
result = namespace[typename]
diff --git a/lib/python/sectracker/xpickle.py b/lib/python/sectracker/xpickle.py
index 216566e5ed..9a7296e4cc 100644
--- a/lib/python/sectracker/xpickle.py
+++ b/lib/python/sectracker/xpickle.py
@@ -29,7 +29,7 @@ def safeunlink(path):
No exception is thrown if the file does not exist."""
try:
_os.unlink(path)
- except OSError, e:
+ except OSError as e:
if e.errno != _errno.ENOENT:
raise e

© 2014-2024 Faster IT GmbH | imprint | privacy policy