diff hgext/notify.py @ 35633:a981ab2a1b4c

py3: use email.parser module to parse email messages Before this patch we use email.Parser.Parser() from the email module which is not available on Python 3. On Python 2: >>> import email >>> import email.parser as emailparser >>> email.Parser.Parser is emailparser.Parser True
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 30 Dec 2017 00:13:56 +0530
parents a0a727104eed
children c8e2d6ed1f9e
line wrap: on
line diff
--- a/hgext/notify.py	Fri Jan 12 22:18:42 2018 +0900
+++ b/hgext/notify.py	Sat Dec 30 00:13:56 2017 +0530
@@ -135,6 +135,7 @@
 from __future__ import absolute_import
 
 import email
+import email.parser as emailparser
 import fnmatch
 import socket
 import time
@@ -339,7 +340,7 @@
                           'and revset\n')
             return
 
-        p = email.Parser.Parser()
+        p = emailparser.Parser()
         try:
             msg = p.parsestr(data)
         except email.Errors.MessageParseError as inst: