Skip to content

Commit 3c586ca

Browse files
authored
bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624)
Signed-off-by: Christian Heimes <christian@python.org>
1 parent 3c4850e commit 3c586ca

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Tools/ssl/multissltests.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from urllib.error import HTTPError
3434
except ImportError:
3535
from urllib2 import urlopen, HTTPError
36+
import re
3637
import shutil
3738
import string
3839
import subprocess
@@ -448,11 +449,14 @@ def _post_install_300(self):
448449
@property
449450
def short_version(self):
450451
"""Short version for OpenSSL download URL"""
451-
short_version = self.version.rstrip(string.ascii_letters)
452-
if short_version.startswith("0.9"):
453-
short_version = "0.9.x"
454-
return short_version
455-
452+
mo = re.search(r"^(\d+)\.(\d+)\.(\d+)", self.version)
453+
parsed = tuple(int(m) for m in mo.groups())
454+
if parsed < (1, 0, 0):
455+
return "0.9.x"
456+
if parsed >= (3, 0, 0):
457+
# OpenSSL 3.0.0 -> /old/3.0/
458+
parsed = parsed[:2]
459+
return ".".join(str(i) for i in parsed)
456460

457461
class BuildLibreSSL(AbstractBuilder):
458462
library = "LibreSSL"

0 commit comments

Comments
 (0)