Skip to content

Commit c4416ce

Browse files
committed
Catch AttributeError
1 parent 920ff42 commit c4416ce

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

download_analytics/metrics.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,16 @@ def _version_element_order_key(version):
110110
last_component = None
111111
last_numeric = None
112112
for component in version.split('.', 2):
113-
numeric = RE_NUMERIC.match(component).group(0)
114-
components.append(int(numeric))
115-
last_component = component
116-
last_numeric = numeric
113+
if RE_NUMERIC.match(component):
114+
try:
115+
numeric = RE_NUMERIC.match(component).group(0)
116+
components.append(int(numeric))
117+
last_component = component
118+
last_numeric = numeric
119+
except AttributeError:
120+
# From time to time this errors out in github actions
121+
# while it shouldn't enter the `if`.
122+
pass
117123

118124
components.append(last_component[len(last_numeric):])
119125

0 commit comments

Comments
 (0)