summaryrefslogtreecommitdiffstats
path: root/Tools/ssl
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-04-26 08:54:12 (GMT)
committerGitHub <noreply@github.com>2021-04-26 08:54:12 (GMT)
commit3c586ca500854476e6eff06713236faff233d035 (patch)
treeb3284cda5b5db293e00047dd7a3c5f047bdf6b1e /Tools/ssl
parent3c4850e222388889426e250ff43308e4802dc582 (diff)
downloadcpython-3c586ca500854476e6eff06713236faff233d035.zip
cpython-3c586ca500854476e6eff06713236faff233d035.tar.gz
cpython-3c586ca500854476e6eff06713236faff233d035.tar.bz2
bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624)
Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Tools/ssl')
-rwxr-xr-xTools/ssl/multissltests.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
index dc47c5c..24d70ac 100755
--- a/Tools/ssl/multissltests.py
+++ b/Tools/ssl/multissltests.py
@@ -33,6 +33,7 @@ try:
from urllib.error import HTTPError
except ImportError:
from urllib2 import urlopen, HTTPError
+import re
import shutil
import string
import subprocess
@@ -448,11 +449,14 @@ class BuildOpenSSL(AbstractBuilder):
@property
def short_version(self):
"""Short version for OpenSSL download URL"""
- short_version = self.version.rstrip(string.ascii_letters)
- if short_version.startswith("0.9"):
- short_version = "0.9.x"
- return short_version
-
+ mo = re.search(r"^(\d+)\.(\d+)\.(\d+)", self.version)
+ parsed = tuple(int(m) for m in mo.groups())
+ if parsed < (1, 0, 0):
+ return "0.9.x"
+ if parsed >= (3, 0, 0):
+ # OpenSSL 3.0.0 -> /old/3.0/
+ parsed = parsed[:2]
+ return ".".join(str(i) for i in parsed)
class BuildLibreSSL(AbstractBuilder):
library = "LibreSSL"