Skip to content

Commit

Permalink
Try/except feels wrong here but it works
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Blanton authored and Chris Blanton committed Feb 10, 2025
1 parent 2812d69 commit 1d0ad28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fre/fre.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
else:
version_minor = version_unexpanded_split[1]
# if the patch version is present, then use it. otherwise, omit
if '2' in range(len(version_unexpanded_split)):
try:
len(version_unexpanded_split[2])
if len(version_unexpanded_split[2]) == 1:
version_patch = "0" + version_unexpanded_split[2]
else:
version_patch = version_unexpanded_split[2]
version = version_unexpanded_split[0] + '.' + version_minor + '.' + version_patch
else:
except IndexError:
version = version_unexpanded_split[0] + '.' + version_minor

# click and lazy group loading
Expand Down

0 comments on commit 1d0ad28

Please sign in to comment.