Ticket #18547: 18547.diff

File 18547.diff, 852 bytes (added by Claude Paroz, 12 years ago)

Catch when xgettext is not found

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

    diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
    index 046ffb4..cc6d3a7 100644
    a b def make_messages(locale=None, domain='django', verbosity=1, all=False,  
    291291        raise CommandError(message)
    292292
    293293    # We require gettext version 0.15 or newer.
    294     output = _popen('xgettext --version')[0]
     294    output, errors = _popen('xgettext --version')
     295    if errors:
     296        raise CommandError("Error running xgettext. Note that Django "
     297                    "internationalization requires GNU gettext 0.15 or newer.")
    295298    match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
    296299    if match:
    297300        xversion = (int(match.group('major')), int(match.group('minor')))
Back to Top