mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)
Ensure custom formatwarning function can receive line as positional argument. Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
This commit is contained in:
parent
91b9ecf82c
commit
be7c460fb5
3 changed files with 22 additions and 1 deletions
|
@ -124,7 +124,7 @@ def _formatwarnmsg(msg):
|
|||
if fw is not _formatwarning_orig:
|
||||
# warnings.formatwarning() was replaced
|
||||
return fw(msg.message, msg.category,
|
||||
msg.filename, msg.lineno, line=msg.line)
|
||||
msg.filename, msg.lineno, msg.line)
|
||||
return _formatwarnmsg_impl(msg)
|
||||
|
||||
def filterwarnings(action, message="", category=Warning, module="", lineno=0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue