setup.py
changeset 44874 4c53c12b92d5
parent 44852 fd3b94f1712d
child 44893 95c832849955
--- a/setup.py	Sat May 30 03:46:59 2020 +0200
+++ b/setup.py	Fri May 29 21:07:26 2020 +0200
@@ -83,6 +83,21 @@
     printf(error, file=sys.stderr)
     sys.exit(1)
 
+import ssl
+
+try:
+    ssl.SSLContext
+except AttributeError:
+    error = """
+The `ssl` module does not have the `SSLContext` class. This indicates an old
+Python version which does not support modern security features (which were
+added to Python 2.7 as part of "PEP 466"). Please make sure you have installed
+at least Python 2.7.9 or a Python version with backports of these security
+features.
+"""
+    printf(error, file=sys.stderr)
+    sys.exit(1)
+
 if sys.version_info[0] >= 3:
     DYLIB_SUFFIX = sysconfig.get_config_vars()['EXT_SUFFIX']
 else: