MCPcopy Create free account
hub / github.com/MITK/MITK / extract_major_minor

Function extract_major_minor

CMakeExternals/Python3_CheckOpenSSL.py:8–18  ·  view source on GitHub ↗

Extracts the major.minor OpenSSL version from a version string. Example: "OpenSSL 3.0.16 11 Feb 2025" -> "3.0"

(version_string: str)

Source from the content-addressed store, hash-verified

6import argparse
7
8def extract_major_minor(version_string: str) -> str:
9 """
10 Extracts the major.minor OpenSSL version from a version string.
11
12 Example:
13 "OpenSSL 3.0.16 11 Feb 2025" -> "3.0"
14 """
15 match = re.search(r"(\d+\.\d+)", version_string)
16 if not match:
17 return ""
18 return match.group(1)
19
20parser = argparse.ArgumentParser(description="Check OpenSSL version used by Python Standalone Builds")
21parser.add_argument("--expected", required=True, help="Expected OpenSSL version (found by CMake)")

Callers 1

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected