From 9bcd4d812ca698fd3a2de8c52cae8e63c261e628 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 18 Dec 2014 14:38:46 +0100 Subject: Fixed #23788 (2) -- Improved gettext version checker Thanks Tim Graham for the report and initial patch. --- django/core/management/commands/makemessages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index ba8de527bf..932bc0897e 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -310,9 +310,9 @@ class Command(BaseCommand): @cached_property def gettext_version(self): out, err, status = popen_wrapper(['xgettext', '--version']) - m = re.search(r'(\d)\.(\d+)\.(\d+)', out) + m = re.search(r'(\d)\.(\d+)\.?(\d+)?', out) if m: - return tuple(int(d) for d in m.groups()) + return tuple(int(d) for d in m.groups() if d is not None) else: raise CommandError("Unable to get gettext version. Is it installed?") -- cgit v1.3