From: Felix Schwarz Date: Mon, 6 Aug 2012 07:41:21 +0000 (+0000) Subject: fix doctests on Python 2.4: In 2.4 re.sub(..., ..., u'') will return '' (str, not... X-Git-Tag: 1.0~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0efe68be9d9877ebe197497fe3c6057cd93ba99;p=thirdparty%2Fbabel.git 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 --- diff --git a/babel/messages/pofile.py b/babel/messages/pofile.py index 5c21bec1..da904954 100644 --- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -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'])