[PULL,4/9] check-venv: use recorded Python version
diff mbox series

Message ID 20190117201743.20470-5-ehabkost@redhat.com
State New
Headers show
Series
  • [PULL,1/9] scripts/device-crash-test: Remove known crashes
Related show

Commit Message

Eduardo Habkost Jan. 17, 2019, 8:17 p.m. UTC
From: Cleber Rosa <crosa@redhat.com>

The current approach works fine, but it runs Python on every make
command (even if it's not related to the venv usage).

This is just an optimization, and not a change of behavior.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181109150710.31085-3-crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 tests/Makefile.include | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/tests/Makefile.include b/tests/Makefile.include
index f403a6571d..f8d4399293 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -958,8 +958,7 @@  TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
 # information please refer to "avocado --help".
 AVOCADO_SHOW=none
 
-PYTHON3 = $(shell $(PYTHON) -c 'import sys; print(1 if sys.version_info >= (3, 0) else 0)')
-ifeq ($(PYTHON3), 1)
+ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2)
 $(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
 	$(call quiet-command, \
             $(PYTHON) -m venv --system-site-packages $@, \