From 2148a4a5c36c8c8fceeb8894a1bf8e71df3a2bc8 Mon Sep 17 00:00:00 2001 From: Maksymilian Potok Date: Sat, 5 Dec 2020 03:16:09 +0100 Subject: [PATCH] python version/setup Added Python version checking, running as script on Python 3.0+ and the latest Python version configuration --- speedtest.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/speedtest.py b/speedtest.py index 92a2be0..c61f054 100755 --- a/speedtest.py +++ b/speedtest.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#! /usr/bin/python3 +#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012 Matt Martz # All Rights Reserved. @@ -19,6 +20,12 @@ import os import re import csv import sys +if sys.version_info[0:2] < (2, 4): + raise Exception( + 'You need Python 2.4+ to use speedtest!\n' + 'Run \u001b[32m./setup.sh\u001b[0m ' + 'to install the newest Python version ' + 'or do it manually!') import math import errno import signal