mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
This commit is contained in:
parent
1989763f0d
commit
f6595983e0
4 changed files with 17 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue