diff --git a/platform.py b/platform.py index b923610d8..abd09da41 100644 --- a/platform.py +++ b/platform.py @@ -305,6 +305,7 @@ def _parse_version(original_version): r"^gcc(?P\d+)_(?P\d+)_(?P\d+)-esp-(?P.+)$", r"^esp-(?P.+)-(?P\d+)\.(?P\d+)\.?(?P\d+)$", r"^esp-(?P\d+)\.(?P\d+)\.(?P\d+)(_(?P.+))?$", + r"^idf-release_v(?P\d+)\.(?P\d+)(.(?P\d+))?(-(?P.+))?$", ) for pattern in version_patterns: match = re.search(pattern, original_version) @@ -312,7 +313,7 @@ def _parse_version(original_version): result = "%s.%s.%s" % ( match.group("MAJOR"), match.group("MINOR"), - match.group("PATCH"), + match.group("PATCH") if match.group("PATCH") is not None else "0", ) if match.group("EXTRA"): result = result + "+%s" % match.group("EXTRA")