jenkins-bot submitted this change.
[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(-)
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 = {}
To view, visit change 693512. To unsubscribe, or for help writing mail filters, visit settings.