Ticket #10234: makemessages_t10234_r10177.diff

File makemessages_t10234_r10177.diff, 1.2 KB (added by Andrew Badr, 16 years ago)

Same patch, corrected format

  • django/core/management/commands/makemessages.py

     
    145145                if file_ext in extensions:
    146146                    src = open(os.path.join(dirpath, file), "rU").read()
    147147                    thefile = '%s.py' % file
    148                     open(os.path.join(dirpath, thefile), "w").write(templatize(src))
     148                    try:
     149                        open(os.path.join(dirpath, thefile), "w").write(templatize(src))
     150                    except SyntaxError, msg:
     151                        msg = "%s (file: %s)" % (msg, os.path.join(dirpath, file))
     152                        raise SyntaxError(msg)
    149153                if verbosity > 1:
    150154                    sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
    151155                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"' % (
Back to Top