diff babel/dates.py @ 391:3eb859adc5de

Fixed a bug in plural.py that caused a traceback for some locales, changed the `__mod__` DateTimePattern to not raise exceptions but return NotImplemented.
author aronacher
date Mon, 14 Jul 2008 22:18:39 +0000
parents ecf110e7f604
children 0f7f4226f765
line wrap: on
line diff
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -731,7 +731,8 @@
         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):
Copyright (C) 2012-2017 Edgewall Software