From 7573c4a9f7b4ab94b835595c35f4ef1154a7e408 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 22 Feb 2010 20:25:43 +0000 Subject: [PATCH] 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 --- tests/regressiontests/makemessages/tests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/regressiontests/makemessages/tests.py b/tests/regressiontests/makemessages/tests.py index e2b61223da..907931f715 100644 --- a/tests/regressiontests/makemessages/tests.py +++ b/tests/regressiontests/makemessages/tests.py @@ -1,4 +1,6 @@ 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'): - from extraction import * +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\d+)\.(?P\d+)', output) + if match: + xversion = (int(match.group('major')), int(match.group('minor'))) + if xversion > (0, 15): + from extraction import *