diff --git a/run_scapy b/run_scapy index c4723fe528de330aa91c7fb9c308a8acd4525ff3..0f4611eee461f3b257622cadaba403e4e7a1147f 100755 --- a/run_scapy +++ b/run_scapy @@ -1,3 +1,8 @@ #! /bin/sh DIR=$(dirname $0) -PYTHONPATH=$DIR exec python -m scapy.__init__ +if python --version | grep -q '^Python 2'; then + PYTHON=python +else + PYTHON=python2 +fi +PYTHONPATH=$DIR exec $PYTHON -m scapy.__init__ diff --git a/test/run_tests b/test/run_tests index 7df78972b7472d9e5f28168e56851dd29ae1722c..3f224ab6b419e377c9de89a21fc28599b97a5950 100755 --- a/test/run_tests +++ b/test/run_tests @@ -1,8 +1,13 @@ #! /bin/bash DIR=$(dirname $0)/.. +if python --version | grep -q '^Python 2'; then + PYTHON=python +else + PYTHON=python2 +fi if [ "$*" == "" ] then -PYTHONPATH=$DIR exec python ${DIR}/scapy/tools/UTscapy.py -t regression.uts -f html -l -o /tmp/scapy_regression_test_$(date +%Y%m%d-%H%M%S).html +PYTHONPATH=$DIR exec $PYTHON ${DIR}/scapy/tools/UTscapy.py -t regression.uts -f html -l -o /tmp/scapy_regression_test_$(date +%Y%m%d-%H%M%S).html else -PYTHONPATH=$DIR exec python ${DIR}/scapy/tools/UTscapy.py "$@" +PYTHONPATH=$DIR exec $PYTHON ${DIR}/scapy/tools/UTscapy.py "$@" fi