From f6545f3e582729d0ac594dc94387e5743c5e8f00 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Mon, 4 Sep 2017 17:59:44 -0400 Subject: [PATCH] Using c.fetchone ()[0] --- lib/gdbcommand.py | 2 +- lib/sumfiles.py | 2 +- master.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gdbcommand.py b/lib/gdbcommand.py index 32e40c0..a623901 100644 --- a/lib/gdbcommand.py +++ b/lib/gdbcommand.py @@ -42,7 +42,7 @@ def create_copy_command (props): con = sqlite3.connect (db_file) c = con.cursor () c.execute ('SELECT COUNT(*) FROM logs WHERE commitid = "%s" AND branch = "%s" AND trysched = 1' % (rev, branch)) - count = int (c.fetchone ()) + count = int (c.fetchone ()[0]) con.close () to_path = os.path.join (get_web_base (), builder, 'try', rev[:2], rev, count) diff --git a/lib/sumfiles.py b/lib/sumfiles.py index a955bca..b94f2e7 100644 --- a/lib/sumfiles.py +++ b/lib/sumfiles.py @@ -79,7 +79,7 @@ class DejaResults(object): con = sqlite3.connect (db_file) c = con.cursor () c.execute ('SELECT COUNT(*) FROM logs WHERE commitid = "%s" AND branch = "%s" AND trysched = 1' % (rev, branch)) - count = int (c.fetchone ()) + count = int (c.fetchone ()[0]) con.close () bdir = os.path.join (gdb_web_base, builder, 'try', rev[:2], rev, count) diff --git a/master.cfg b/master.cfg index 50022f6..0e2c703 100644 --- a/master.cfg +++ b/master.cfg @@ -445,7 +445,7 @@ send to the gdb-testers mailing list.""" con = sqlite3.connect (db_file) c = con.cursor () c.execute ('SELECT COUNT(*) FROM logs WHERE commitid = "%s" AND branch = "%s" AND trysched = 1' % (sourcestamp.revision, branch)) - count = int (c.fetchone ()) + count = int (c.fetchone ()[0]) con.close () try_to = build.getReason ().strip ("'try' job by user ")