Runnable with both Python3 and Python2, with PyQt4 #2249

Open
kashikoibumi wants to merge 60 commits from kashikoibumi/py3 into v0.6
3 changed files with 4 additions and 4 deletions
Showing only changes of commit 07953592aa - Show all commits

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