Philipp Hörist pushed to branch master at gajim / gajim

Commits:
6f3c2111 by Philipp Hörist at 2017-08-02T18:57:02+02:00
Stay compatible to python 3.4

Fixes #8690

- - - - -


2 changed files:

- gajim/common/logger.py
- gajim/emoticons.py


Changes:

=====================================
gajim/common/logger.py
=====================================
--- a/gajim/common/logger.py
+++ b/gajim/common/logger.py
@@ -676,7 +676,7 @@ class Logger:
 
         try:
             messages = self.con.execute(
-                sql, (*jids, restore, pending)).fetchall()
+                sql, tuple(jids) + (restore, pending)).fetchall()
         except sqlite.DatabaseError:
             self.dispatch('DB_ERROR',
                           exceptions.DatabaseMalformed(LOG_DB_PATH))
@@ -722,8 +722,8 @@ class Logger:
             ORDER BY time, log_line_id
             '''.format(jids=', '.join('?' * len(jids)))
 
-        return self.con.execute(sql, (*jids, 
-                                      date.timestamp(),
+        return self.con.execute(sql, tuple(jids) +
+                                      (date.timestamp(),
                                       (date + delta).timestamp())).fetchall()
 
     def search_log(self, account, jid, query, date=None):
@@ -765,7 +765,7 @@ class Logger:
         '''.format(jids=', '.join('?' * len(jids)),
                    date_search=between if date else '')
 
-        return self.con.execute(sql, (*jids, query)).fetchall()
+        return self.con.execute(sql, tuple(jids) + (query,)).fetchall()
 
     def get_days_with_logs(self, account, jid, year, month):
         """
@@ -803,8 +803,8 @@ class Logger:
             """.format(jids=', '.join('?' * len(jids)),
                        kinds=', '.join(kinds))
 
-        return self.con.execute(sql, (*jids,
-                                      date.timestamp(),
+        return self.con.execute(sql, tuple(jids) +
+                                      (date.timestamp(),
                                       (date + delta).timestamp())).fetchall()
 
     def get_last_date_that_has_logs(self, account, jid):
@@ -831,7 +831,7 @@ class Logger:
 
         # fetchone() returns always at least one Row with all
         # attributes set to None because of the MAX() function
-        return self.con.execute(sql, (*jids,)).fetchone().time
+        return self.con.execute(sql, tuple(jids)).fetchone().time
 
     def get_room_last_message_time(self, account, jid):
         """
@@ -1210,7 +1210,7 @@ class Logger:
               '''.format(columns=', '.join(kwargs.keys()),
                          values=', '.join('?' * len(kwargs)))
 
-        lastrowid = self.con.execute(sql, (jid, time_, kind, 
*kwargs.values())).lastrowid
+        lastrowid = self.con.execute(sql, (jid, time_, kind) + 
tuple(kwargs.values())).lastrowid
 
         if unread and kind == KindConstant.CHAT_MSG_RECV:
             sql = '''INSERT INTO unread_messages (message_id, jid_id)


=====================================
gajim/emoticons.py
=====================================
--- a/gajim/emoticons.py
+++ b/gajim/emoticons.py
@@ -20,6 +20,7 @@ import sys
 import logging
 import importlib.util as imp
 from collections import OrderedDict
+from importlib.machinery import SourceFileLoader
 
 from gi.repository import GdkPixbuf, Gtk, GLib
 
@@ -65,10 +66,9 @@ def load(path):
         module_name = 'emoticons_theme.pyc'
         theme_path = os.path.join(path, module_name)
 
-    spec = imp.spec_from_file_location(module_name, theme_path)
+    loader = SourceFileLoader(module_name, theme_path)
     try:
-        theme = imp.module_from_spec(spec)
-        spec.loader.exec_module(theme)
+        theme = loader.load_module()
     except FileNotFoundError:
         log.exception('Emoticons theme not found')
         return



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/6f3c21118f9d1c88d1a725381dea963d709f01f0

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/6f3c21118f9d1c88d1a725381dea963d709f01f0
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to