Skip to content

Commit

Permalink
fixup! pyln: Add a version parser to pyln-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Feb 21, 2024
1 parent 12f05c9 commit 18328fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/pyln-testing/pyln/testing/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def __eq__(self, other):
@classmethod
def from_str(cls, s: str) -> "Version":
m = re.search(r'^v(\d+).(\d+).?(\d+)?(rc\d+)?', s)
if m is None:
raise ValueError(f"Could not parse version {s}")
parts = [int(m.group(i)) for i in range(1, 4) if m.group(i) is not None]
year, month = parts[0], parts[1]
if len(parts) == 3:
Expand Down

0 comments on commit 18328fc

Please sign in to comment.