diff options
author | sblondon <sblondon@users.noreply.github.com> | 2018-05-09 09:39:32 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-05-09 09:39:32 (GMT) |
commit | 8cf4b34b3665b8bb39ea7111e6b5c3410899d3e4 (patch) | |
tree | 4348734bb3b2b4add0c979018bb5c35a6c2cda96 /Lib/cgitb.py | |
parent | ddb6215a55b0218b621d5cb755e9dfac8dab231a (diff) | |
download | cpython-8cf4b34b3665b8bb39ea7111e6b5c3410899d3e4.zip cpython-8cf4b34b3665b8bb39ea7111e6b5c3410899d3e4.tar.gz cpython-8cf4b34b3665b8bb39ea7111e6b5c3410899d3e4.tar.bz2 |
bpo-33311: Do not display parameters displayed in parentheses for module call. (GH-6677)
Diffstat (limited to 'Lib/cgitb.py')
-rw-r--r-- | Lib/cgitb.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/cgitb.py b/Lib/cgitb.py index 0f5f32c0..4f81271 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -124,8 +124,9 @@ 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(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 = {} @@ -207,8 +208,9 @@ function calls leading up to the error, in the order they occurred. 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 = {} |