Ticket #5519: failure.patch

File failure.patch, 882 bytes (added by vperic, 4 years ago)
  • twisted/python/failure.py

    diff --git twisted/python/failure.py twisted/python/failure.py
    index ed03281..0016ce7 100644
    class _Code(object): 
    140140        self.co_filename = filename
    141141
    142142
    143 class Failure:
     143class Failure(BaseException):
    144144    """
    145145    A basic abstraction for an error that has occurred.
    146146
  • twisted/test/test_failure.py

    diff --git twisted/test/test_failure.py twisted/test/test_failure.py
    index 3963f8c..f2fd0e4 100644
    class TestDebugMode(unittest.TestCase): 
    554554        origInit = failure.Failure.__dict__['__init__']
    555555        def restore():
    556556            pdb.post_mortem = post_mortem
    557             failure.Failure.__dict__['__init__'] = origInit
     557            setattr(failure.Failure, '__init__', origInit)
    558558        self.addCleanup(restore)
    559559
    560560        self.result = []