summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-01-15 00:18:15 +0000
committerRamiro Morales <cramm0@gmail.com>2011-01-15 00:18:15 +0000
commit8b4dffd8df93610688552e45d4752cad79ff3fcc (patch)
tree4942d7ccb10a9f30b84857c4c540ae384f7386c7 /tests
parent0bd628d418348bbda936f10c03d5e9d910986580 (diff)
Modified a try block construct in a test case to be compatible with Python 2.4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/i18n/commands/extraction.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py
index 9061863e67..f17bb47197 100644
--- a/tests/regressiontests/i18n/commands/extraction.py
+++ b/tests/regressiontests/i18n/commands/extraction.py
@@ -63,10 +63,11 @@ class BasicExtractorTests(ExtractorTests):
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