From: benselme Date: Fri, 9 Jan 2015 16:17:07 +0000 (-0500) Subject: Fix to_python when i is not provided to evaluate function X-Git-Tag: dev-2a51c9b95d06~51^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=071e38a1c9d882e3290430255a5a707d3d9aa8e0;p=thirdparty%2Fbabel.git Fix to_python when i is not provided to evaluate function --- diff --git a/babel/plural.py b/babel/plural.py index b11b17e5..7ce62e1f 100644 --- a/babel/plural.py +++ b/babel/plural.py @@ -184,8 +184,8 @@ def to_python(rule): } to_python_func = _PythonCompiler().compile result = [ - 'def evaluate(n, v=0, w=0, f=0, t=0):', - ' i = int(n)', + 'def evaluate(n, i=None, v=0, w=0, f=0, t=0):', + ' i = int(n) if i is None else i', ] for tag, ast in PluralRule.parse(rule).abstract: # the str() call is to coerce the tag to the native string. It's