Parse Python version in `[from ...]` marker.
(self, thenceforth: str)
| 1149 | ) |
| 1150 | |
| 1151 | def parse_version(self, thenceforth: str) -> VersionTuple: |
| 1152 | """Parse Python version in `[from ...]` marker.""" |
| 1153 | assert isinstance(self.function, Function) |
| 1154 | |
| 1155 | try: |
| 1156 | major, minor = thenceforth.split(".") |
| 1157 | return int(major), int(minor) |
| 1158 | except ValueError: |
| 1159 | fail( |
| 1160 | f"Function {self.function.name!r}: expected format '[from major.minor]' " |
| 1161 | f"where 'major' and 'minor' are integers; got {thenceforth!r}" |
| 1162 | ) |
| 1163 | |
| 1164 | def parse_star(self, function: Function, version: VersionTuple | None) -> None: |
| 1165 | """Parse keyword-only parameter marker '*'. |
no test coverage detected