From 64108c844d19e3ddbad3eb4f18ce350658e35f0a Mon Sep 17 00:00:00 2001
From: Michal Terepeta <michal.terepeta@gmail.com>
Date: Sun, 14 Oct 2012 20:28:48 +0200
Subject: [PATCH] mk/timeout: use python2 when possible

---
 mk/boilerplate.mk  | 5 +++++
 timeout/calibrate  | 2 --
 timeout/timeout.py | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/mk/boilerplate.mk b/mk/boilerplate.mk
index 56b0284..a34e884 100644
--- a/mk/boilerplate.mk
+++ b/mk/boilerplate.mk
@@ -125,7 +125,12 @@ $(eval $(call canonicalise,TOP_ABS))
 GS = gs
 CP = cp
 RM = rm -f
+
+# Prefer "python2"
 PYTHON = python
+ifeq "$(shell test -x $(which python2) && echo exists)" "exists"
+  PYTHON = python2
+endif
 
 # -----------------------------------------------------------------------------
 # configuration of TEST_HC
diff --git a/timeout/calibrate b/timeout/calibrate
index b0d75da..2867d00 100644
--- a/timeout/calibrate
+++ b/timeout/calibrate
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 import math
 import os
 from os import *
diff --git a/timeout/timeout.py b/timeout/timeout.py
index 76660a7..2fba027 100644
--- a/timeout/timeout.py
+++ b/timeout/timeout.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 
 import errno
 import os
-- 
1.7.12.3

