jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693512 )
Change subject: [cleanup] Disallow non-numeric i18n count ......................................................................
[cleanup] Disallow non-numeric i18n count
When 'num' was a string representation of a number rather than an int we issued a deprecation warning. Time to enforce it.
Change-Id: Ie7b491674a44ca9f8b42942441d0c49af2b5ba29 --- M pywikibot/i18n.py 1 file changed, 2 insertions(+), 7 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 5399c85..5eaf720 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -38,7 +38,6 @@ ModuleDeprecationWrapper, deprecated, deprecated_args, - issue_deprecation_warning, )
@@ -441,12 +440,8 @@ variants = match.group(2) num = parameters[selector] if not isinstance(num, int): - issue_deprecation_warning( - 'type {} for value {} ({})' - .format(type(num), selector, num), - 'an int', 1, - warning_class=FutureWarning, since='20151009') - num = int(num) + raise ValueError("'{}' must be a number, not a {} ({})" + .format(selector, num, type(num).__name__))
plural_entries = [] specific_entries = {}
pywikibot-commits@lists.wikimedia.org