From 5fad455ff41c7ab8acb8b41ea1c9c752830ce1ea Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 15 Oct 2009 15:00:57 -0600 Subject: Fixed try/except/finally for Python 2.4 compatability --- ipaserver/rpcserver.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'ipaserver') diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py index 06fb5aeea..72f221992 100644 --- a/ipaserver/rpcserver.py +++ b/ipaserver/rpcserver.py @@ -103,25 +103,26 @@ class WSGIExecutioner(Executioner): error = None _id = None try: - self.create_context(ccache=environ.get('KRB5CCNAME')) - if ( - environ.get('CONTENT_TYPE', '').startswith(self.content_type) - and environ['REQUEST_METHOD'] == 'POST' - ): - data = read_input(environ) - (name, args, options, _id) = self.unmarshal(data) - else: - (name, args, options, _id) = self.simple_unmarshal(environ) - if name not in self.Command: - raise CommandError(name=name) - result = self.Command[name](*args, **options) - except PublicError, e: - error = e - except StandardError, e: - self.exception( - 'non-public: %s: %s', e.__class__.__name__, str(e) - ) - error = InternalError() + try: + self.create_context(ccache=environ.get('KRB5CCNAME')) + if ( + environ.get('CONTENT_TYPE', '').startswith(self.content_type) + and environ['REQUEST_METHOD'] == 'POST' + ): + data = read_input(environ) + (name, args, options, _id) = self.unmarshal(data) + else: + (name, args, options, _id) = self.simple_unmarshal(environ) + if name not in self.Command: + raise CommandError(name=name) + result = self.Command[name](*args, **options) + except PublicError, e: + error = e + except StandardError, e: + self.exception( + 'non-public: %s: %s', e.__class__.__name__, str(e) + ) + error = InternalError() finally: destroy_context() return self.marshal(result, error, _id) -- cgit