]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Enforce Python version in `setup.py` 239/head
authorRyan J Ollos <ryanollos@verasonics.com>
Mon, 21 Sep 2015 17:33:47 +0000 (10:33 -0700)
committerRyan J Ollos <ryanollos@verasonics.com>
Mon, 21 Sep 2015 17:33:47 +0000 (10:33 -0700)
Print error message and exit if Python version requirement not satisfied.

setup.py

index bc2ed02a54ae23ed2c431642fed15d783f574e10..fa77fcc45893bbc8f834ee24305ede9486b093ce 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,16 @@
 # -*- coding: utf-8 -*-
 
-import os
 import sys
+if sys.version_info < (2, 6) or (3,) <= sys.version_info < (3, 3):
+    print("Babel requires Python 2.6, 2.7 or 3.3+")
+    sys.exit(1)
+
+
+import os
 import subprocess
 from setuptools import setup
 
+
 sys.path.append(os.path.join('doc', 'common'))
 try:
     from doctools import build_doc, test_doc