diff babel3/babel/plural.py @ 494:cddcd04db33e experimental

Commit the resulting files after a 2to3 -nvw run.
author jruigrok
date Thu, 15 Apr 2010 14:20:11 +0000
parents 0b228ee775fe
children
line wrap: on
line diff
--- a/babel3/babel/plural.py
+++ b/babel3/babel/plural.py
@@ -56,7 +56,7 @@
         :raise RuleError: if the expression is malformed
         """
         if isinstance(rules, dict):
-            rules = rules.items()
+            rules = list(rules.items())
         found = set()
         self.abstract = []
         for key, expr in rules:
@@ -165,7 +165,7 @@
     for tag, ast in PluralRule.parse(rule).abstract:
         result.append(' if (%s): return %r' % (to_python(ast), tag))
     result.append(' return %r' % _fallback_tag)
-    exec '\n'.join(result) in namespace
+    exec('\n'.join(result), namespace)
     return namespace['evaluate']
 
 
@@ -382,7 +382,8 @@
     output formats.
     """
 
-    def compile(self, (op, args)):
+    def compile(self, xxx_todo_changeme):
+        (op, args) = xxx_todo_changeme
         return getattr(self, 'compile_' + op)(*args)
 
     compile_n = lambda x: 'n'
@@ -413,7 +414,7 @@
 
     def compile_relation(self, method, expr, range):
         expr = self.compile(expr)
-        min, max = map(self.compile, range[1])
+        min, max = list(map(self.compile, range[1]))
         return '(%s >= %s && %s <= %s)' % (expr, min, expr, max)
 
 
Copyright (C) 2012-2017 Edgewall Software