Author: ramiro
Date: 2011-01-14 18:18:15 -0600 (Fri, 14 Jan 2011)
New Revision: 15209
Modified:
django/trunk/tests/regressiontests/i18n/commands/extraction.py
Log:
Modified a try block construct in a test case to be compatible with Python 2.4.
Modified: django/trunk/tests/regressiontests/i18n/commands/extraction.py
===================================================================
--- django/trunk/tests/regressiontests/i18n/commands/extraction.py
2011-01-15 00:15:39 UTC (rev 15208)
+++ django/trunk/tests/regressiontests/i18n/commands/extraction.py
2011-01-15 00:18:15 UTC (rev 15209)
@@ -63,10 +63,11 @@
os.chdir(self.test_dir)
shutil.copyfile('./templates/template_with_error.txt',
'./templates/template_with_error.html')
self.assertRaises(SyntaxError, management.call_command,
'makemessages', locale=LOCALE, verbosity=0)
- try:
- management.call_command('makemessages', locale=LOCALE, verbosity=0)
- except SyntaxError, e:
- self.assertEqual(str(e), 'Translation blocks must not include
other block tags: blocktrans (file templates/template_with_error.html, line 3)')
+ try: # TODO: Simplify this try/try block when we drop support for
Python 2.4
+ try:
+ management.call_command('makemessages', locale=LOCALE,
verbosity=0)
+ except SyntaxError, e:
+ self.assertEqual(str(e), 'Translation blocks must not include
other block tags: blocktrans (file templates/template_with_error.html, line 3)')
finally:
os.remove('./templates/template_with_error.html')
os.remove('./templates/template_with_error.html.py') # Waiting for
#8536 to be fixed
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.