Commit 84deecad authored by 's avatar

simplified code: 'except SystemExit' and 'except ImportError' do the same.

It is very unlikely that v is a tuple and 'hasattr(sys, 'exc_info')' is always true.
parent 93b5a98c
...@@ -236,17 +236,12 @@ def publish_module_standard(module_name, ...@@ -236,17 +236,12 @@ def publish_module_standard(module_name,
setDefaultSkin(request) setDefaultSkin(request)
response = publish(request, module_name, after_list, debug=debug) response = publish(request, module_name, after_list, debug=debug)
except SystemExit, v: except (SystemExit, ImportError):
must_die=sys.exc_info() must_die = sys.exc_info()
request.response.exception(must_die) request.response.exception(1)
except ImportError, v:
if isinstance(v, tuple) and len(v)==3: must_die=v
elif hasattr(sys, 'exc_info'): must_die=sys.exc_info()
else: must_die = SystemExit, v, sys.exc_info()[2]
request.response.exception(1, v)
except: except:
request.response.exception() request.response.exception()
status=response.getStatus() status = response.getStatus()
if response: if response:
outputBody=getattr(response, 'outputBody', None) outputBody=getattr(response, 'outputBody', None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment