Skip to content

Commit

Permalink
bpo-33311: Do not display parameters displayed in parentheses for mod…
Browse files Browse the repository at this point in the history
…ule call. (GH-6677)
  • Loading branch information
sblondon authored and serhiy-storchaka committed May 9, 2018
1 parent ddb6215 commit 8cf4b34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lib/cgitb.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ def html(einfo, context=5):
args, varargs, varkw, locals = inspect.getargvalues(frame)
call = ''
if func != '?':
call = 'in ' + strong(pydoc.html.escape(func)) + \
inspect.formatargvalues(args, varargs, varkw, locals,
call = 'in ' + strong(pydoc.html.escape(func))
if func != "<module>":
call += inspect.formatargvalues(args, varargs, varkw, locals,
formatvalue=lambda value: '=' + pydoc.html.repr(value))

highlight = {}
Expand Down Expand Up @@ -207,8 +208,9 @@ def text(einfo, context=5):
args, varargs, varkw, locals = inspect.getargvalues(frame)
call = ''
if func != '?':
call = 'in ' + func + \
inspect.formatargvalues(args, varargs, varkw, locals,
call = 'in ' + func
if func != "<module>":
call += inspect.formatargvalues(args, varargs, varkw, locals,
formatvalue=lambda value: '=' + pydoc.text.repr(value))

highlight = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Text and html output generated by cgitb does not display parentheses if the
current call is done directly in the module. Patch by Stéphane Blondon.

0 comments on commit 8cf4b34

Please sign in to comment.