[PATCH] correctly reraise errors with six
Nicolas Sebrecht
nicolas.s-dev at laposte.net
Tue Jul 5 23:55:22 BST 2016
On Tue, Jul 05, 2016 at 11:17:32PM +0200, Łukasz Żarnowiecki wrote:
> On Wed, Jun 29, 2016 at 03:45:01AM +0200, Nicolas Sebrecht wrote:
> > class MappedIMAPFolder(IMAPFolder):
> > """IMAP class to map between Folder() instances where both side assign a uid
> > @@ -63,8 +64,11 @@ class MappedIMAPFolder(IMAPFolder):
> > try:
> > line = line.strip()
> > except ValueError:
> > - six.reraise(Exception("Corrupt line '%s' in UID mapping file '%s'"%
> > - (line, mapfilename)), None, exc_info()[2])
> > + six.reraise(Exception,
> > + Exception(
> > + "Corrupt line '%s' in UID mapping file '%s'"%
> > + (line, mapfilename)),
> > + exc_info()[2])
>
> I am not a fan of this patch. It makes thing looks more uglier that it
> was before. But that just my opinion
I agree it's looks ugly. OTOH, it makes clear what method are the
arguments for. I don't have strong opinion on this. The purpose of this
patch is to insert the missing 'error type' argument everywhere.
--
Nicolas Sebrecht
More information about the OfflineIMAP-project
mailing list