[PATCH 1 of 3] hook: use sys.exc_info rather than the deprecated equivalents

Siddharth Agarwal sid0 at fb.com
Fri Feb 12 07:04:11 UTC 2016


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1455256972 28800
#      Thu Feb 11 22:02:52 2016 -0800
# Node ID 8afad172ca2c68b1d1f8f814bbf08911479f3140
# Parent  a036e1ae1fbe88ab99cb861ebfc2e4da7a3912ca
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 8afad172ca2c
hook: use sys.exc_info rather than the deprecated equivalents

sys.exc_type etc have been deprecated since Python 1.5.

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -50,12 +50,12 @@ def _pythonhook(ui, repo, name, hname, f
             try:
                 obj = __import__(modname)
             except ImportError:
-                e1 = sys.exc_type, sys.exc_value, sys.exc_traceback
+                e1 = sys.exc_info()
                 try:
                     # extensions are loaded with hgext_ prefix
                     obj = __import__("hgext_%s" % modname)
                 except ImportError:
-                    e2 = sys.exc_type, sys.exc_value, sys.exc_traceback
+                    e2 = sys.exc_info()
                     if ui.tracebackflag:
                         ui.warn(_('exception from first failed import '
                                   'attempt:\n'))


More information about the Mercurial-devel mailing list