Fixed try/except/finally for Python 2.4 compatability

This commit is contained in:
Jason Gerard DeRose 2009-10-15 15:00:57 -06:00
parent 8dc21d6f30
commit 5fad455ff4

View File

@ -103,25 +103,26 @@ class WSGIExecutioner(Executioner):
error = None error = None
_id = None _id = None
try: try:
self.create_context(ccache=environ.get('KRB5CCNAME')) try:
if ( self.create_context(ccache=environ.get('KRB5CCNAME'))
environ.get('CONTENT_TYPE', '').startswith(self.content_type) if (
and environ['REQUEST_METHOD'] == 'POST' environ.get('CONTENT_TYPE', '').startswith(self.content_type)
): and environ['REQUEST_METHOD'] == 'POST'
data = read_input(environ) ):
(name, args, options, _id) = self.unmarshal(data) data = read_input(environ)
else: (name, args, options, _id) = self.unmarshal(data)
(name, args, options, _id) = self.simple_unmarshal(environ) else:
if name not in self.Command: (name, args, options, _id) = self.simple_unmarshal(environ)
raise CommandError(name=name) if name not in self.Command:
result = self.Command[name](*args, **options) raise CommandError(name=name)
except PublicError, e: result = self.Command[name](*args, **options)
error = e except PublicError, e:
except StandardError, e: error = e
self.exception( except StandardError, e:
'non-public: %s: %s', e.__class__.__name__, str(e) self.exception(
) 'non-public: %s: %s', e.__class__.__name__, str(e)
error = InternalError() )
error = InternalError()
finally: finally:
destroy_context() destroy_context()
return self.marshal(result, error, _id) return self.marshal(result, error, _id)