six: changed offlineimap/folder/LocalStatusSQLite.py

This patch removes the library six, compatible with python2.

I need change these re-raise calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This commit is contained in:
Rodolfo García Peñas (kix) 2020-09-03 20:30:14 +02:00
parent a922ab3103
commit dd3e7616cf

View File

@ -19,9 +19,6 @@ import os
import sqlite3 as sqlite import sqlite3 as sqlite
from sys import exc_info from sys import exc_info
from threading import Lock from threading import Lock
import six
from .Base import BaseFolder from .Base import BaseFolder
@ -117,13 +114,11 @@ class LocalStatusSQLiteFolder(BaseFolder):
self._databaseFileLock.registerNewUser() self._databaseFileLock.registerNewUser()
except sqlite.OperationalError as e: except sqlite.OperationalError as e:
# Operation had failed. # Operation had failed.
six.reraise(UserWarning, raise UserWarning(
UserWarning( "cannot open database file '%s': %s.\nYou might"
"cannot open database file '%s': %s.\nYou might" " want to check the rights to that file and if "
" want to check the rights to that file and if " "it cleanly opens with the 'sqlite<3>' command" %
"it cleanly opens with the 'sqlite<3>' command" % (self.filename, e), exc_info()[2])
(self.filename, e)),
exc_info()[2])
# Test if db version is current enough and if db is readable. # Test if db version is current enough and if db is readable.
try: try:
@ -351,10 +346,9 @@ class LocalStatusSQLiteFolder(BaseFolder):
self.__sql_write('INSERT INTO status (id,flags,mtime,labels) VALUES (?,?,?,?)', self.__sql_write('INSERT INTO status (id,flags,mtime,labels) VALUES (?,?,?,?)',
(uid, flags, mtime, labels)) (uid, flags, mtime, labels))
except Exception as e: except Exception as e:
six.reraise(UserWarning, raise UserWarning("%s while inserting UID %s" %
UserWarning("%s while inserting UID %s" % (str(e), str(uid)),
(str(e), str(uid))), exc_info()[2])
exc_info()[2])
return uid return uid
# Interface from BaseFolder # Interface from BaseFolder