[diffoscope] 01/01: setup.py: add a check to prevent people from installing diffoscope under python < 3.4 (i.e. python2) and give them a usable error message otherwise

Mattia Rizzolo mattia at debian.org
Sat Sep 16 12:07:07 CEST 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository diffoscope.

commit 734fb55457697b5f155911d5cc1a8194a807bf91
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sat Sep 16 12:06:41 2017 +0200

    setup.py: add a check to prevent people from installing diffoscope under python < 3.4 (i.e. python2) and give them a usable error message otherwise
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 setup.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/setup.py b/setup.py
index b173e05..5cd5fb9 100644
--- a/setup.py
+++ b/setup.py
@@ -7,6 +7,13 @@ from setuptools import setup, find_packages
 from setuptools.command.test import test as TestCommand
 
 
+try:
+    assert sys.version_info >= (3, 4)
+except AssertionError:
+    from __future__ import print_function
+    print("diffoscope requires at least python 3.4", file=sys.stderr)
+
+
 class PyTest(TestCommand):
     user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list