Skip to content

Commit 87b6e26

Browse files
authored
Handle release tag formats in _parse_tag() (#4548)
* Handle release tag formats in _parse_tag() Also accommodate formal release tags, so the generated version is correct for downstream packagers. * Also handle release candidate format in _parse_tag()
1 parent 79974f2 commit 87b6e26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scapy/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ def _parse_tag(tag):
3737
# remove the 'v' prefix and add a '.devN' suffix
3838
return '%s.dev%s' % (match.group(1), match.group(2))
3939
else:
40-
raise ValueError('tag has invalid format')
40+
match = re.match('^v?([\\d\\.]+(rc\\d+)?)$', tag)
41+
if match:
42+
# tagged release version
43+
return '%s' % (match.group(1))
44+
else:
45+
raise ValueError('tag has invalid format')
4146

4247

4348
def _version_from_git_archive():

0 commit comments

Comments
 (0)