Ticket #4: foolscap-copiedremoteexception.hgexport.patch

File foolscap-copiedremoteexception.hgexport.patch, 1.2 kB (added by strank, 2 years ago)

updated patch for current trunk

  • a/foolscap/call.py

    old new  
    820820 
    821821        return state 
    822822 
     823class CopiedRemoteException(Exception): 
     824    """I represent an exception thrown on the remote end 
     825    (real Exception, old-style instance, or string), 
     826    I am a base class for locally reconstructed Exceptions. 
     827    You can catch me in a try block if you want. 
     828    """  
     829 
    823830class CopiedFailure(failure.Failure, copyable.RemoteCopyOldStyle): 
    824831    # this is a RemoteCopyOldStyle because you can't raise new-style 
    825832    # instances as exceptions. 
     
    887894 
    888895        assert isinstance(self.type, str) 
    889896        typepieces = self.type.split(".") 
    890         class ExceptionLikeString
     897        class ExceptionLikeString(CopiedRemoteException)
    891898            pass 
    892899        self.type = ExceptionLikeString 
    893900        self.type.__module__ = ".".join(typepieces[:-1])