Commit 7573c4a9 authored by Jannis Leidel's avatar Jannis Leidel
Browse files

Updated the check for gettext introduced in r12475 to also look at the version.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent a3e2ddde
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
import os
import re
from subprocess import Popen, PIPE

def find_command(cmd, path=None, pathext=None):
    if path is None:
@@ -26,5 +28,12 @@ def find_command(cmd, path=None, pathext=None):

# checks if it can find xgettext on the PATH and
# imports the extraction tests if yes
if find_command('xgettext'):
xgettext_cmd = find_command('xgettext')
if xgettext_cmd:
    p = Popen('%s --version' % xgettext_cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True)
    output = p.communicate()[0]
    match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
    if match:
        xversion = (int(match.group('major')), int(match.group('minor')))
        if xversion > (0, 15):
            from extraction import *