xref: /linux/tools/perf/tests/shell/lib/setup_python.sh (revision 5cc5e030bce2ec97ae5cdb2c1b94a98b1047b3fa)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4if [ "x$PYTHON" = "x" ]
5then
6  python3 --version >/dev/null 2>&1 && PYTHON=python3
7fi
8if [ "x$PYTHON" = "x" ]
9then
10  python --version >/dev/null 2>&1 && PYTHON=python
11fi
12if [ "x$PYTHON" = "x" ]
13then
14  echo Skipping test, python not detected please set environment variable PYTHON.
15  exit 2
16fi
17