Code

Ticket #10234: makemessages_t10234_r10177.diff

File makemessages_t10234_r10177.diff, 1.2 KB (added by andrewbadr, 5 years ago)

Same patch, corrected format

Line 
1Index: django/core/management/commands/makemessages.py
2===================================================================
3--- django/core/management/commands/makemessages.py     (revision 10177)
4+++ django/core/management/commands/makemessages.py     (working copy)
5@@ -145,7 +145,11 @@
6                 if file_ext in extensions:
7                     src = open(os.path.join(dirpath, file), "rU").read()
8                     thefile = '%s.py' % file
9-                    open(os.path.join(dirpath, thefile), "w").write(templatize(src))
10+                    try:
11+                        open(os.path.join(dirpath, thefile), "w").write(templatize(src))
12+                    except SyntaxError, msg:
13+                        msg = "%s (file: %s)" % (msg, os.path.join(dirpath, file))
14+                        raise SyntaxError(msg)
15                 if verbosity > 1:
16                     sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
17                 cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (