summaryrefslogtreecommitdiffstats
path: root/bindings/lang_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/lang_python.py')
-rw-r--r--bindings/lang_python.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/bindings/lang_python.py b/bindings/lang_python.py
index f4f051f8..928051fb 100644
--- a/bindings/lang_python.py
+++ b/bindings/lang_python.py
@@ -105,12 +105,9 @@ class Error(Exception):
@staticmethod
def raise_on_rc(rc):
global exceptions_dict
- exception = exceptions_dict.get(rc)
- if not exception:
- raise LassoError()
- else:
- exception.code = rc
- raise exception
+ exception = exceptions_dict.get(rc, Error())
+ exception.code = rc
+ raise exception
def __str__(self):
return '<lasso.%s(%s): %s>' % (self.__class__.__name__, self.code, _lasso.strError(self.code))