fix careless mistakes

This commit is contained in:
Kashiko Koibumi 2024-05-30 20:09:16 +09:00
parent d676ea3ec2
commit 07953592aa
No known key found for this signature in database
GPG Key ID: 8F06E069E37C40C4
3 changed files with 4 additions and 4 deletions

View File

@ -1467,10 +1467,10 @@ class BMRPCDispatcher(object):
# Stream Number length # Stream Number length
readPosition += decodeVarint( readPosition += decodeVarint(
payload[readPosition:readPosition + 10])[1] payload[readPosition:readPosition + 10])[1]
t = (payload[readPosition:readPosition + 32], sqlite3.Binary(hash01)) t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), sqlite3.Binary(hash01))
_, rowcount = sql.execute("UPDATE inventory SET tag=? WHERE hash=?", *t) _, rowcount = sql.execute("UPDATE inventory SET tag=? WHERE hash=?", *t)
if rowcount < 1: if rowcount < 1:
t = (payload[readPosition:readPosition + 32], hash01) t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), hash01)
sql.execute("UPDATE inventory SET tag=? WHERE hash=CAST(? AS TEXT)", *t) sql.execute("UPDATE inventory SET tag=? WHERE hash=CAST(? AS TEXT)", *t)
queryreturn = sqlQuery( queryreturn = sqlQuery(

View File

@ -3277,7 +3277,7 @@ class MyForm(settingsmixin.SMainWindow):
if total_row_count < 1: if total_row_count < 1:
sqlExecuteChunked( sqlExecuteChunked(
"UPDATE inbox SET folder='inbox' WHERE msgid IN({0})", "UPDATE inbox SET folder='inbox' WHERE msgid IN({0})",
True, idCount, *inventoryHashesToTrash, as_text=True) True, idCount, *inventoryHashesToTrash)
tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1) tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1)
tableWidget.setUpdatesEnabled(True) tableWidget.setUpdatesEnabled(True)
self.propagateUnreadCount() self.propagateUnreadCount()

View File

@ -357,7 +357,7 @@ class TestCore(unittest.TestCase):
if len(column_type) < 1: if len(column_type) < 1:
column_type = sqlQuery( column_type = sqlQuery(
'''select typeof(msgid) from sent where ackdata=CAST(? AS TEXT)''', result) '''select typeof(msgid) from sent where ackdata=CAST(? AS TEXT)''', result)
self.assertEqual(column_type[0][0] if column_type else '', 'text') self.assertEqual(column_type[0][0] if column_type else '', 'blob')
@unittest.skipIf(frozen, 'not packed test_pattern into the bundle') @unittest.skipIf(frozen, 'not packed test_pattern into the bundle')
def test_old_knownnodes_pickle(self): def test_old_knownnodes_pickle(self):