jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235581?usp=email )
Change subject: IMPR: show Pywikibot version in deprecation warnings for config
variables
......................................................................
IMPR: show Pywikibot version in deprecation warnings for config variables
Change-Id: I8f91027bdb2c53fb9f3926f2fa9bdba97ae5766d
---
M pywikibot/config.py
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/config.py b/pywikibot/config.py
index 8fd441c..7adee70 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -987,9 +987,10 @@
DEPRECATED_VARIABLE = (
- f'"{{}}" present in your {user_config_file} is no longer a supported'
- ' configuration variable and should be removed. Please inform the'
- ' maintainers if you depend on it.'
+ '"{name}" present in your '
+ f'{user_config_file} is deprecated since'
+ ' {since} and no longer a supported configuration variable and should be'
+ ' removed. Please inform the maintainers if you depend on it.'
)
@@ -1013,7 +1014,11 @@
user_config[name] = value
elif not name.startswith('_') and name not in skipped:
if name in _deprecated_variables:
- warn('\n' + fill(DEPRECATED_VARIABLE.format(name)),
+ msg = DEPRECATED_VARIABLE.format(
+ name=name,
+ since=_deprecated_variables[name]
+ )
+ warn('\n' + fill(msg),
_ConfigurationDeprecationWarning, stacklevel=2)
else:
warn('\n' + fill(f'Configuration variable "{name}" is defined '
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235581?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8f91027bdb2c53fb9f3926f2fa9bdba97ae5766d
Gerrit-Change-Number: 1235581
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]