From ac9af8971af59599eb62c297b8d2d392abe51bb8 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Tue, 29 Apr 2008 12:09:59 +0000 Subject: [project @ fpeters@0d.be-20080406145608-13ngws5566q8jkj9] simplified raise_on_rc Original author: Frederic Peters Date: 2008-04-06 16:56:08.973000+02:00 --- bindings/lang_python.py | 9 +++------ 1 file 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 '' % (self.__class__.__name__, self.code, _lasso.strError(self.code)) -- cgit