[Zope-Checkins] SVN: Zope/trunk/src/ZPublisher/Publish.py simplified code: 'except SystemExit' and 'except ImportError' do the same.
Yvo Schubbe
y.2010 at wcm-solutions.de
Wed Apr 14 10:17:21 EDT 2010
Log message for revision 110896:
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.
Changed:
UU Zope/trunk/src/ZPublisher/Publish.py
-=-
Modified: Zope/trunk/src/ZPublisher/Publish.py
===================================================================
--- Zope/trunk/src/ZPublisher/Publish.py 2010-04-14 14:14:11 UTC (rev 110895)
+++ Zope/trunk/src/ZPublisher/Publish.py 2010-04-14 14:17:20 UTC (rev 110896)
@@ -236,17 +236,12 @@
setDefaultSkin(request)
response = publish(request, module_name, after_list, debug=debug)
- except SystemExit, v:
- must_die=sys.exc_info()
- request.response.exception(must_die)
- 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 (SystemExit, ImportError):
+ must_die = sys.exc_info()
+ request.response.exception(1)
except:
request.response.exception()
- status=response.getStatus()
+ status = response.getStatus()
if response:
outputBody=getattr(response, 'outputBody', None)
Property changes on: Zope/trunk/src/ZPublisher/Publish.py
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
- 1.167
More information about the Zope-Checkins
mailing list