Author: jezdez
Date: 2010-02-22 14:25:43 -0600 (Mon, 22 Feb 2010)
New Revision: 12493

Modified:
   django/trunk/tests/regressiontests/makemessages/tests.py
Log:
Updated the check for gettext introduced in r12475 to also look at the version.

Modified: django/trunk/tests/regressiontests/makemessages/tests.py
===================================================================
--- django/trunk/tests/regressiontests/makemessages/tests.py    2010-02-22 
15:48:19 UTC (rev 12492)
+++ django/trunk/tests/regressiontests/makemessages/tests.py    2010-02-22 
20:25:43 UTC (rev 12493)
@@ -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 @@
 
 # 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<major>\d+)\.(?P<minor>\d+)', output)
+    if match:
+        xversion = (int(match.group('major')), int(match.group('minor')))
+        if xversion > (0, 15):
+            from extraction import *

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to