[ovs-dev] [PATCH] tests: Use compat argparse when required.

Ethan Jackson ethan at nicira.com
Tue Sep 27 22:51:37 UTC 2011


Some build environments don't have argparse installed.  In these
cases the test framework will use the compat version.
---
 tests/atlocal.in |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tests/atlocal.in b/tests/atlocal.in
index 0166f0f..7f09143 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -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
-- 
1.7.6.1




More information about the dev mailing list