1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Ensured that makemessages doesn't leave any temporary file over if the parsing of a template file fails. Refs #8536.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Julien Phalip
2011-12-21 15:35:58 +00:00
parent 39109b0e44
commit 45e3dff5ac
2 changed files with 7 additions and 8 deletions

View File

@@ -229,9 +229,10 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
if file_ext in extensions:
src = open(orig_file, "rU").read()
thefile = '%s.py' % file
content = templatize(src, orig_file[2:])
f = open(os.path.join(dirpath, thefile), "w")
try:
f.write(templatize(src, orig_file[2:]))
f.write(content)
finally:
f.close()
if verbosity > 1: