Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_version(self, version: str) -> Dict[str, str]:
assert self.version_regex
match = self.version_regex.fullmatch(version)
if match is None:
raise InvalidVersion(version=version, regex=self.version_regex)
return match.groupdict()