about summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2020-06-22 12:28:34 +0200
committertoonn <toonn@toonn.io>2020-06-22 12:30:33 +0200
commitb8b540916f14b8a4c48fac13c38daa9e3ebf2a3c (patch)
tree52918137f3a494d9669338f531b54fca64b24945 /Makefile
parent1654128f955b320354eea98a0bb6970a159ab16f (diff)
downloadranger-b8b540916f14b8a4c48fac13c38daa9e3ebf2a3c.tar.gz
Default to python3 at install, fall back to python
Since `python` is supposed to always point to a python 2.x executable
and python 2.x is no longer supported by the PSF, we should try to
install with `python3` by default and fall back to `python` and then
`python2`.

Fixes #2006
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d70728f6..82a6153a 100644
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,9 @@ VERSION_RIFLE = $(VERSION)
 SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
 # Find suitable python version (need python >= 2.6 or 3.1):
 PYTHON ?= $(shell \
-	     (python -c 'import sys; sys.exit(sys.version < "2.6")' && \
+	     (which python3) \
+	     || (python -c 'import sys; sys.exit(sys.version < "2.6")' && \
 	      which python) \
-	     || (which python3) \
 	     || (python2 -c 'import sys; sys.exit(sys.version < "2.6")' && \
 	         which python2) \
 	   )