Commit 33bb12c6 authored by Jim Fulton's avatar Jim Fulton

changes to deal with Python 1.5 exceptions

parent eb6ad17b
'''CGI Response Output formatter '''CGI Response Output formatter
$Id: Response.py,v 1.42 1998/11/20 18:16:36 jim Exp $''' $Id: Response.py,v 1.43 1998/12/02 16:58:54 jim Exp $'''
# #
# Copyright (c) 1996-1998, Digital Creations, Fredericksburg, VA, USA. # Copyright (c) 1996-1998, Digital Creations, Fredericksburg, VA, USA.
# All rights reserved. # All rights reserved.
...@@ -51,7 +51,7 @@ $Id: Response.py,v 1.42 1998/11/20 18:16:36 jim Exp $''' ...@@ -51,7 +51,7 @@ $Id: Response.py,v 1.42 1998/11/20 18:16:36 jim Exp $'''
# #
# (540) 371-6909 # (540) 371-6909
# #
__version__='$Revision: 1.42 $'[11:-2] __version__='$Revision: 1.43 $'[11:-2]
import string, types, sys, regex import string, types, sys, regex
from string import find, rfind, lower, upper, strip, split, join, translate from string import find, rfind, lower, upper, strip, split, join, translate
...@@ -488,7 +488,7 @@ class Response: ...@@ -488,7 +488,7 @@ class Response:
b=v b=v
if fatal: if fatal:
if t is SystemExit and v==0: if t is SystemExit and v.code==0:
tb=self.setBody( tb=self.setBody(
(str(t), (str(t),
'This application has exited normally.<p>' 'This application has exited normally.<p>'
......
...@@ -110,7 +110,7 @@ class PCGIPublisher: ...@@ -110,7 +110,7 @@ class PCGIPublisher:
try: try:
f = open(self.errorLogFile, 'a+') f = open(self.errorLogFile, 'a+')
f.write("%s %s\n" % (timeStamp, errmsg)) f.write("%s %s\n" % (timeStamp, errmsg))
if sys.exc_type != 'SystemExit': if sys.exc_type != SystemExit:
trace=StringIO.StringIO() trace=StringIO.StringIO()
traceback.print_exception(sys.exc_type, traceback.print_exception(sys.exc_type,
sys.exc_value, sys.exc_value,
......
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