summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--babel/dates.py3
-rw-r--r--babel/plural.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/babel/dates.py b/babel/dates.py
index 2802004..5e2723a 100644
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -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):
diff --git a/babel/plural.py b/babel/plural.py
index c7cf41e..dd50ede 100644
--- a/babel/plural.py
+++ b/babel/plural.py
@@ -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):