MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _as_int

Function _as_int

tools/python-3.11.9-amd64/Lib/gettext.py:168–185  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

166
167
168def _as_int(n):
169 try:
170 round(n)
171 except TypeError:
172 raise TypeError('Plural value must be an integer, got %s' %
173 (n.__class__.__name__,)) from None
174
175 import warnings
176 frame = sys._getframe(1)
177 stacklevel = 2
178 while frame.f_back is not None and frame.f_globals.get('__name__') == __name__:
179 stacklevel += 1
180 frame = frame.f_back
181 warnings.warn('Plural value must be an integer, got %s' %
182 (n.__class__.__name__,),
183 DeprecationWarning,
184 stacklevel)
185 return n
186
187
188def c2py(plural):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected