Mercurial > babel > mirror
changeset 586:46410022772a trunk
fix doctests on Python 2.4: In 2.4 re.sub(..., ..., u'') will return '' (str, not unicode) so just fill in some msgstr to avoid that problem
author | fschwarz |
---|---|
date | Mon, 06 Aug 2012 07:41:21 +0000 |
parents | 5c9dba5dd311 |
children | 964cd2ec6f94 |
files | babel/messages/pofile.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -93,15 +93,15 @@ ... #: 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 @@ ... 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'])