File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ Fixed:
142
142
option is off when the setting is missing from
143
143
detectors/config.ini. Other templates do not implement this option.
144
144
(John Rouillard)
145
+ - issue2551350 - Python changes for 3.12 with roundup 2.3.0. Fixes for
146
+ cgitb.py crash due to pydoc.html.header() signature change. (Patch
147
+ by Andrew (kragacles), applied John Rouillard)
145
148
146
149
Features:
147
150
Original file line number Diff line number Diff line change @@ -127,10 +127,18 @@ def html(context=5, i18n=None):
127
127
if type (etype ) is type :
128
128
etype = etype .__name__
129
129
pyver = 'Python ' + sys .version .split ()[0 ] + '<br>' + sys .executable
130
- head = pydoc .html .heading (
131
- _ ('<font size=+1><strong>%(exc_type)s</strong>: %(exc_value)s</font>' )
132
- % {'exc_type' : etype , 'exc_value' : evalue },
133
- '#ffffff' , '#777777' , pyver )
130
+
131
+ if sys .version_info [0 :2 ] >= (3 ,11 ):
132
+ head = pydoc .html .heading (
133
+ _ ('<font size=+1><strong>%(exc_type)s</strong>: '
134
+ '%(exc_value)s</font>' )
135
+ % {'exc_type' : etype , 'exc_value' : evalue }, pyver )
136
+ else :
137
+ head = pydoc .html .heading (
138
+ _ ('<font size=+1><strong>%(exc_type)s</strong>: '
139
+ '%(exc_value)s</font>' )
140
+ % {'exc_type' : etype , 'exc_value' : evalue },
141
+ '#ffffff' , '#777777' , pyver )
134
142
135
143
head = head + (_ ('<p>A problem occurred while running a Python script. '
136
144
'Here is the sequence of function calls leading up to '
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ def test_pt_html(self):
223
223
else :
224
224
self .assertEqual (expected2 , p )
225
225
226
- def notest_html (self ):
226
+ def test_html (self ):
227
227
""" templating error """
228
228
# enabiling this will cause the test to fail as the variable
229
229
# is included in the live output but not in expected.
You can’t perform that action at this time.
0 commit comments