Code

Ticket #18547: 18547.diff

File 18547.diff, 852 bytes (added by claudep, 2 years ago)

Catch when xgettext is not found

Line 
1diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
2index 046ffb4..cc6d3a7 100644
3--- a/django/core/management/commands/makemessages.py
4+++ b/django/core/management/commands/makemessages.py
5@@ -291,7 +291,10 @@ def make_messages(locale=None, domain='django', verbosity=1, all=False,
6         raise CommandError(message)
7 
8     # We require gettext version 0.15 or newer.
9-    output = _popen('xgettext --version')[0]
10+    output, errors = _popen('xgettext --version')
11+    if errors:
12+        raise CommandError("Error running xgettext. Note that Django "
13+                    "internationalization requires GNU gettext 0.15 or newer.")
14     match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
15     if match:
16         xversion = (int(match.group('major')), int(match.group('minor')))