Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: tko/parsers/version_1.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tko/parsers/version_1.py
diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py
index 111f7efaf6ade54bcbb98bf648c838be939bf96c..7448c4fd28575083e1a0aee83ce57c37f569c999 100644
--- a/tko/parsers/version_1.py
+++ b/tko/parsers/version_1.py
@@ -70,11 +70,14 @@ class iteration(models.iteration):
val_type = "perf"
# parse the actual value into a dict
- if val_type == "attr":
- attr_dict[key] = value
- elif val_type == "perf" and re.search("^\d+(\.\d+)?$", value):
- perf_dict[key] = float(value)
- else:
+ try:
+ if val_type == "attr":
+ attr_dict[key] = value
+ elif val_type == "perf":
+ perf_dict[key] = float(value)
+ else:
+ raise ValueError
+ except ValueError:
msg = ("WARNING: line '%s' found in test "
"iteration keyval could not be parsed")
msg %= line

Powered by Google App Engine
This is Rietveld 408576698