tests: Use compat argparse when required.
authorEthan Jackson <ethan@nicira.com>
Tue, 27 Sep 2011 22:31:18 +0000 (15:31 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 27 Sep 2011 22:51:26 +0000 (15:51 -0700)
Some build environments don't have argparse installed.  In these
cases the test framework will use the compat version.

tests/atlocal.in

index 0166f0f0c32290d826482b4a02c314400995851a..7f09143f4711d206ed046981372ad986d12679bd 100644 (file)
@@ -9,3 +9,12 @@ export PYTHONPATH
 
 PYTHONIOENCODING=utf_8
 export PYTHONIOENCODING
+
+if test $HAVE_PYTHON = yes; then
+    if python -m argparse 2>/dev/null; then
+        :
+    else
+        PYTHONPATH=$PYTHONPATH:$abs_top_srcdir/python/compat
+        export PYTHONPATH
+   fi
+fi