summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2016-09-02 13:56:38 -0500
committerRyan S. Arnold <ryan.arnold@linaro.org>2016-09-02 13:56:38 -0500
commit86dce83c6b6c389bd38bcdb30498ee46bfac6d84 (patch)
tree25bc3e26344744c7beec7ff15814174e5a2ff905
parent2e634bbbd96a42819a6d6c5af74d5f5686a0c841 (diff)
linaropy/series.py: Validate that 'rcN' is an integer when creating series from a tag or branchname
-rw-r--r--linaropy/series.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/linaropy/series.py b/linaropy/series.py
index 16e70a5..93452d9 100644
--- a/linaropy/series.py
+++ b/linaropy/series.py
@@ -457,9 +457,10 @@ def series_from_branchname(branch=None):
else:
# strip the "rc" and just leave the int.
if dictionary["rc"].startswith("rc"):
- dictionary["rc"]=dictionary["rc"][2:]
- if not dictionary["rc"].isnumeric():
- raise TypeError("The rc value must be numeric.")
+ try:
+ dictionary["rc"]=int(dictionary["rc"][2:])
+ except ValueError:
+ raise TypeError("The rc value must be an integer.")
# We need to have None fields in the missing keys for when we call the
# Series constructor.