]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
fix doctests on Python 2.4: In 2.4 re.sub(..., ..., u'') will return '' (str, not...
authorFelix Schwarz <felix.schwarz@oss.schwarz.eu>
Mon, 6 Aug 2012 07:41:21 +0000 (07:41 +0000)
committerFelix Schwarz <felix.schwarz@oss.schwarz.eu>
Mon, 6 Aug 2012 07:41:21 +0000 (07:41 +0000)
babel/messages/pofile.py

index 5c21bec136772a88ad4fd4cc8fb82c7772c1576a..da904954b1567e33f4fdbee5c9849068500950e7 100644 (file)
@@ -93,15 +93,15 @@ def read_po(fileobj, locale=None, domain=None, ignore_obsolete=False):
     ... #: main.py:1
     ... #, fuzzy, python-format
     ... msgid "foo %(name)s"
-    ... msgstr ""
+    ... msgstr "quux %(name)s"
     ...
     ... # A user comment
     ... #. An auto comment
     ... #: main.py:3
     ... msgid "bar"
     ... msgid_plural "baz"
-    ... msgstr[0] ""
-    ... msgstr[1] ""
+    ... msgstr[0] "bar"
+    ... msgstr[1] "baaz"
     ... ''')
     >>> catalog = read_po(buf)
     >>> catalog.revision_date = datetime(2007, 04, 01)
@@ -111,10 +111,10 @@ def read_po(fileobj, locale=None, domain=None, ignore_obsolete=False):
     ...         print (message.id, message.string)
     ...         print ' ', (message.locations, message.flags)
     ...         print ' ', (message.user_comments, message.auto_comments)
-    (u'foo %(name)s', u'')
+    (u'foo %(name)s', u'quux %(name)s')
       ([(u'main.py', 1)], set([u'fuzzy', u'python-format']))
       ([], [])
-    ((u'bar', u'baz'), (u'', u''))
+    ((u'bar', u'baz'), (u'bar', u'baaz'))
       ([(u'main.py', 3)], set([]))
       ([u'A user comment'], [u'An auto comment'])