diff hgext/notify.py @ 27227:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents 5a84a453b503
children
line wrap: on
line diff
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -135,7 +135,7 @@
 
 import email, socket, time
 from mercurial.i18n import _
-from mercurial import patch, cmdutil, util, mail
+from mercurial import patch, cmdutil, util, mail, error
 import fnmatch
 
 # Note for extension authors: ONLY specify testedwith = 'internal' for
@@ -277,7 +277,7 @@
         try:
             msg = p.parsestr(data)
         except email.Errors.MessageParseError as inst:
-            raise util.Abort(inst)
+            raise error.Abort(inst)
 
         # store sender and subject
         sender, subject = msg['From'], msg['Subject']