]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Fixed a bug in plural.py that caused a traceback for some locales, changed the `__mod...
authorArmin Ronacher <armin.ronacher@active-4.com>
Mon, 14 Jul 2008 22:18:39 +0000 (22:18 +0000)
committerArmin Ronacher <armin.ronacher@active-4.com>
Mon, 14 Jul 2008 22:18:39 +0000 (22:18 +0000)
babel/dates.py
babel/plural.py

index 2802004326f398a28984ee982a6d23680653bd21..5e2723ab29516799ad1b66bf632e576acc8ca401 100644 (file)
@@ -731,7 +731,8 @@ class DateTimePattern(object):
         return self.pattern
 
     def __mod__(self, other):
-        assert type(other) is DateTimeFormat
+        if type(other) is not DateTimeFormat:
+            return NotImplemented
         return self.format % other
 
     def apply(self, datetime, locale):
index c7cf41e834af4a31d35de8075bbbcb162337f853..dd50edefbbf5812ecbaab159d711d32aaba50304 100644 (file)
@@ -351,7 +351,7 @@ class _Parser(object):
     def expr(self):
         self.expect('word', 'n')
         if self.skip('word', 'mod'):
-            return 'mod', (('n', None), self.value())
+            return 'mod', (('n', ()), self.value())
         return 'n', ()
 
     def value(self):