correctly reraise errors with six
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
		| @@ -228,9 +228,12 @@ class SyncableAccount(Account): | ||||
|             pass | ||||
|         except IOError: | ||||
|             self._lockfd.close() | ||||
|             six.reraise(OfflineImapError("Could not lock account %s. Is another " | ||||
|                 "instance using this account?"% self, | ||||
|                 OfflineImapError.ERROR.REPO), None, exc_info()[2]) | ||||
|             six.reraise(OfflineImapError, | ||||
|                         OfflineImapError( | ||||
|                             "Could not lock account %s. Is another " | ||||
|                             "instance using this account?"% self, | ||||
|                             OfflineImapError.ERROR.REPO), | ||||
|                         exc_info()[2]) | ||||
|  | ||||
|     def _unlock(self): | ||||
|         """Unlock the account, deleting the lock file""" | ||||
| @@ -552,10 +555,12 @@ def syncfolder(account, remotefolder, quick): | ||||
|         localstart = localfolder.getstartdate() | ||||
|         remotestart = remotefolder.getstartdate() | ||||
|         if (maxage != None) + (localstart != None) + (remotestart != None) > 1: | ||||
|             six.reraise(OfflineImapError("You can set at most one of the " | ||||
|                 "following: maxage, startdate (for the local folder), " | ||||
|                 "startdate (for the remote folder)", | ||||
|                 OfflineImapError.ERROR.REPO), None, exc_info()[2]) | ||||
|             six.reraise(OfflineImapError, | ||||
|                         OfflineImapError("You can set at most one of the " | ||||
|                             "following: maxage, startdate (for the local " | ||||
|                             "folder), startdate (for the remote folder)", | ||||
|                             OfflineImapError.ERROR.REPO), | ||||
|                         exc_info()[2]) | ||||
|         if (maxage != None or localstart or remotestart) and quick: | ||||
|             # IMAP quickchanged isn't compatible with options that | ||||
|             # involve restricting the messagelist, since the "quick" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nicolas Sebrecht
					Nicolas Sebrecht