Patchwork [1,of,5,py3] error: wrap super() init call in try/except

login
register
mail settings
Submitter Augie Fackler
Date Nov. 10, 2016, 10:10 p.m.
Message ID <ee65fbd6dde3b95c6270.1478815839@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/17467/
State Changes Requested
Headers show

Comments

Augie Fackler - Nov. 10, 2016, 10:10 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1476019730 14400
#      Sun Oct 09 09:28:50 2016 -0400
# Node ID ee65fbd6dde3b95c62708c34eec81c88a8d1fe1f
# Parent  038547a14d850f14ecd2671852093dc07848a134
error: wrap super() init call in try/except

This is how we have to handle object's pickiness while still correctly
handling multiple inheritance MRO nonsense.

Patch

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -23,7 +23,10 @@  class Hint(object):
     """
     def __init__(self, *args, **kw):
         self.hint = kw.pop('hint', None)
-        super(Hint, self).__init__(*args, **kw)
+        try:
+            super(Hint, self).__init__(*args, **kw)
+        except TypeError:
+            pass
 
 class RevlogError(Hint, Exception):
     pass