Skip to content

Commit 74b029d

Browse files
committed
dedupe code for normalization and the actual version parsing
1 parent e64c199 commit 74b029d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

python/private/version.bzl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,10 @@ def _parse(version_str, strict = True):
518518
Returns:
519519
string containing the normalized version.
520520
"""
521-
if strict:
522-
version_str = version_str.strip() # PEP 440: Leading and Trailing Whitespace
523-
is_prefix = False
524-
else:
525-
version_str = version_str.strip() # PEP 440: Leading and Trailing Whitespace
521+
version_str = version_str.strip() # PEP 440: Leading and Trailing Whitespace
522+
is_prefix = False
523+
524+
if not strict:
526525
is_prefix = version_str.endswith(".*")
527526
version_str = version_str.strip(" .*") # PEP 440: Leading and Trailing Whitespace and ".*"
528527

0 commit comments

Comments
 (0)