summaryrefslogtreecommitdiffstats
path: root/Lib/warnings.py
diff options
context:
space:
mode:
authorXtreak <tir.karthi@gmail.com>2019-03-01 17:17:55 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-03-01 17:17:55 (GMT)
commitbe7c460fb50efe3b88a00281025d76acc62ad2fd (patch)
tree3646fb5a8f89312c018a5bcc3629558f476964bc /Lib/warnings.py
parent91b9ecf82c3287b45f39158c5134a87414ff26bc (diff)
downloadcpython-be7c460fb50efe3b88a00281025d76acc62ad2fd.zip
cpython-be7c460fb50efe3b88a00281025d76acc62ad2fd.tar.gz
cpython-be7c460fb50efe3b88a00281025d76acc62ad2fd.tar.bz2
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>
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r--Lib/warnings.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py
index cf88131..00f740c 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -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,