Using c.fetchone ()[0]

This commit is contained in:
Sergio Durigan Junior 2017-09-04 17:59:44 -04:00
parent ba4070a977
commit f6545f3e58
3 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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 ")