bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)

This commit is contained in:
Serhiy Storchaka 2017-03-12 13:15:01 +02:00 committed by GitHub
parent 1989763f0d
commit f6595983e0
4 changed files with 17 additions and 3 deletions

View file

@ -164,6 +164,10 @@ def _as_int(n):
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):