mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442)
(cherry picked from commit 7d68bfa826
)
Co-authored-by: sblondon <sblondon@users.noreply.github.com>
This commit is contained in:
parent
cebce2e8d1
commit
736f17fb8d
4 changed files with 5 additions and 2 deletions
|
@ -124,7 +124,7 @@ function calls leading up to the error, in the order they occurred.</p>'''
|
|||
args, varargs, varkw, locals = inspect.getargvalues(frame)
|
||||
call = ''
|
||||
if func != '?':
|
||||
call = 'in ' + strong(func) + \
|
||||
call = 'in ' + strong(pydoc.html.escape(func)) + \
|
||||
inspect.formatargvalues(args, varargs, varkw, locals,
|
||||
formatvalue=lambda value: '=' + pydoc.html.repr(value))
|
||||
|
||||
|
@ -282,7 +282,7 @@ class Hook:
|
|||
|
||||
if self.display:
|
||||
if plain:
|
||||
doc = doc.replace('&', '&').replace('<', '<')
|
||||
doc = pydoc.html.escape(doc)
|
||||
self.file.write('<pre>' + doc + '</pre>\n')
|
||||
else:
|
||||
self.file.write(doc + '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue