]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
setup.py: check for Python 2.7 or newer.
authorJason Ish <ish@unx.ca>
Tue, 18 Dec 2018 15:21:00 +0000 (09:21 -0600)
committerJason Ish <ish@unx.ca>
Tue, 18 Dec 2018 22:29:14 +0000 (16:29 -0600)
Display message and exit if Python is less than 2.7.

setup.py

index 3c5c661bcefa8a79a339716a5334194cec53f1aa..a6acdf69bdf44004f504fe996fdb16c469de100d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+import sys
 import os.path
 import subprocess
 import distutils
@@ -7,6 +8,13 @@ from distutils.core import sys
 from suricata.update.version import version
 
 
+version_major = sys.version_info[0]
+version_minor = sys.version_info[1]
+
+if version_major < 3 and version_minor < 7:
+    print("Suricata-Update requires Python 2.7 or newer.")
+    sys.exit(0)
+
 def write_git_revision():
     if not os.path.exists(".git"):
         return