Return the AWS Lambda runtime string for the current Python version.
()
| 250 | |
| 251 | |
| 252 | def get_runtime_from_python_version() -> str: |
| 253 | """Return the AWS Lambda runtime string for the current Python version.""" |
| 254 | major, minor = sys.version_info[:2] |
| 255 | if major < 3 or minor < 9: |
| 256 | raise ValueError(f"Python {major}.{minor} is no longer supported.") |
| 257 | if minor > 14: |
| 258 | raise ValueError(f"Python {major}.{minor} is not yet supported.") |
| 259 | return f"python{major}.{minor}" |
| 260 | |
| 261 | |
| 262 | ## |