commit | f6595983e08fe20cf06a2535d74d912c6dbb044f | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Sun Mar 12 13:15:01 2017 +0200 |
committer | GitHub <noreply@github.com> | Sun Mar 12 13:15:01 2017 +0200 |
tree | d25d4e69e082af9db5f9cc469eabb93834b0bd7d | |
parent | 1989763f0d0858ce6274f5e1d725b5b8da91a780 [diff] [blame] |
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
diff --git a/Lib/gettext.py b/Lib/gettext.py index 57d2c74..aa1d555 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py
@@ -164,6 +164,10 @@ except TypeError: raise TypeError('Plural value must be an integer, got %s' % (n.__class__.__name__,)) from None + import warnings + warnings.warn('Plural value must be an integer, got %s' % + (n.__class__.__name__,), + DeprecationWarning, 4) return n def c2py(plural):