Patchwork notify: just use email.errors

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 14, 2018, 11:45 a.m.
Message ID <3a82d82492d32c4340e3.1539517544@mimosa>
Download mbox | patch
Permalink /patch/35986/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 14, 2018, 11:45 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1539516947 -7200
#      Sun Oct 14 13:35:47 2018 +0200
# Node ID 3a82d82492d32c4340e336dc5d3814bf6b5ff2f9
# Parent  96164fb9b9130bc2148fc454cf4c6eed0797c001
notify: just use email.errors

email.Errors is a proxy object to email.errors on Python 2.
Pulkit Goyal - Oct. 14, 2018, 12:21 p.m.
On Sun, Oct 14, 2018 at 2:47 PM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1539516947 -7200
> #      Sun Oct 14 13:35:47 2018 +0200
> # Node ID 3a82d82492d32c4340e336dc5d3814bf6b5ff2f9
> # Parent  96164fb9b9130bc2148fc454cf4c6eed0797c001
> notify: just use email.errors
>
> email.Errors is a proxy object to email.errors on Python 2.
>

Queued this one, many thanks!
Augie Fackler - Oct. 14, 2018, 12:30 p.m.
> On Oct 14, 2018, at 13:45, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1539516947 -7200
> #      Sun Oct 14 13:35:47 2018 +0200
> # Node ID 3a82d82492d32c4340e336dc5d3814bf6b5ff2f9
> # Parent  96164fb9b9130bc2148fc454cf4c6eed0797c001
> notify: just use email.errors
> 
> email.Errors is a proxy object to email.errors on Python 2.

I could have sworn I saw failures when I did this, but now I don't see them. I'm not sure what I did wrong. :/

Looks like this got pushed, or something equivalent. Thanks!

> 
> diff --git a/hgext/notify.py b/hgext/notify.py
> --- a/hgext/notify.py
> +++ b/hgext/notify.py
> @@ -141,7 +141,7 @@ web.baseurl
> '''
> from __future__ import absolute_import
> 
> -import email
> +import email.errors as emailerrors
> import email.parser as emailparser
> import fnmatch
> import socket
> @@ -153,7 +153,6 @@ from mercurial import (
>     logcmdutil,
>     mail,
>     patch,
> -    pycompat,
>     registrar,
>     util,
> )
> @@ -162,11 +161,6 @@ from mercurial.utils import (
>     stringutil,
> )
> 
> -if pycompat.ispy3:
> -    import email.errors as emailerrors
> -else:
> -    emailerrors = email.Errors
> -
> # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
> # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
> # be specifying the version(s) of Mercurial they are tested with, or
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -141,7 +141,7 @@  web.baseurl
 '''
 from __future__ import absolute_import
 
-import email
+import email.errors as emailerrors
 import email.parser as emailparser
 import fnmatch
 import socket
@@ -153,7 +153,6 @@  from mercurial import (
     logcmdutil,
     mail,
     patch,
-    pycompat,
     registrar,
     util,
 )
@@ -162,11 +161,6 @@  from mercurial.utils import (
     stringutil,
 )
 
-if pycompat.ispy3:
-    import email.errors as emailerrors
-else:
-    emailerrors = email.Errors
-
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or