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

login
register
mail settings
Submitter Siddharth Agarwal
Date Feb. 12, 2016, 7:04 a.m.
Message ID <8afad172ca2c68b1d1f8.1455260651@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/13127/
State Accepted
Headers show

Comments

Siddharth Agarwal - Feb. 12, 2016, 7:04 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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'))