Ticket #4: foolscap-copiedremoteexception.patch

File foolscap-copiedremoteexception.patch, 1.2 KB (added by strank, 17 years ago)
  • foolscap/call.py

    d:\HOME\_testen\foolscap-trunk\foolscap>python C:\Python25\Scripts\hg diff 
    diff -r 9cae9c15aef3 foolscap/call.py
    a b class FailureSlicer(slicer.BaseSlicer): 
    766766        state['parents'] = obj.parents
    767767        return state
    768768
     769
     770class CopiedRemoteException(Exception):
     771    """I represent an exception thrown on the remote end
     772    (real Exception, old-style instance, or string),
     773    I am a base class for locally reconstructed Exceptions.
     774    You can catch me in a try block if you want.
     775    """
     776
    769777class CopiedFailure(failure.Failure, copyable.RemoteCopyOldStyle):
    770778    # this is a RemoteCopyOldStyle because you can't raise new-style
    771779    # instances as exceptions.
    class CopiedFailure(failure.Failure, cop 
    821829
    822830        assert isinstance(self.type, str)
    823831        typepieces = self.type.split(".")
    824         class ExceptionLikeString:
     832        class ExceptionLikeString(CopiedRemoteException):
    825833            pass
    826834        self.type = ExceptionLikeString
    827835        self.type.__module__ = ".".join(typepieces[:-1])