summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:09:59 +0000
committerFrederic Peters <fpeters@entrouvert.com>2008-04-29 12:09:59 +0000
commitac9af8971af59599eb62c297b8d2d392abe51bb8 (patch)
tree20054158bcf442dbadf1c9b08fd89a39d4a5073c
parentc0650e55a6fa2aca6095b6447cab9f6a3db0c182 (diff)
downloadlasso-ac9af8971af59599eb62c297b8d2d392abe51bb8.tar.gz
lasso-ac9af8971af59599eb62c297b8d2d392abe51bb8.tar.xz
lasso-ac9af8971af59599eb62c297b8d2d392abe51bb8.zip
[project @ fpeters@0d.be-20080406145608-13ngws5566q8jkj9]
simplified raise_on_rc Original author: Frederic Peters <fpeters@0d.be> Date: 2008-04-06 16:56:08.973000+02:00
-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))