aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-03-12 13:15:01 +0200
committerGitHub <noreply@github.com>2017-03-12 13:15:01 +0200
commitf6595983e08fe20cf06a2535d74d912c6dbb044f (patch)
treed25d4e69e082af9db5f9cc469eabb93834b0bd7d /Lib/gettext.py
parentbpo-20185: Convert the resource moduel to Argument Clinic. (#545) (diff)
downloadcpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.tar.gz
cpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.tar.bz2
cpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.zip
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
Diffstat (limited to 'Lib/gettext.py')
-rw-r--r--Lib/gettext.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/gettext.py b/Lib/gettext.py
index 57d2c74982e..aa1d55561f9 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -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):