From be7c460fb50efe3b88a00281025d76acc62ad2fd Mon Sep 17 00:00:00 2001 From: Xtreak Date: Fri, 1 Mar 2019 22:47:55 +0530 Subject: bpo-35178: Fix warnings._formatwarnmsg() (GH-12033) Ensure custom formatwarning function can receive line as positional argument. Co-Authored-By: Tashrif Billah --- Lib/warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/warnings.py') diff --git a/Lib/warnings.py b/Lib/warnings.py index cf88131f87..00f740ca3a 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, -- cgit v1.2.1