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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user