Skip to content

Commit

Permalink
Modified a try block construct in a test case to be compatible with P…
Browse files Browse the repository at this point in the history
…ython 2.4.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
ramiro committed Jan 15, 2011
1 parent b64ad11 commit 88b491e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/regressiontests/i18n/commands/extraction.py
Expand Up @@ -63,10 +63,11 @@ def test_extraction_error(self):
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
Expand Down

0 comments on commit 88b491e

Please sign in to comment.