#NEWLINE# def removeMethod( self , klass , methodName ) : #NEWLINE# #INDENT# "\n        Remove 'methodName' from 'klass'.\n\n        If 'klass' does not have a method named 'methodName', then\n        'removeMethod' succeeds silently.\n\n        If 'klass' does have a method named 'methodName', then it is removed\n        using delattr. Also, methods of the same name are removed from all\n        base classes of 'klass', thus removing the method entirely.\n\n        @param klass: The class to remove the method from.\n        @param methodName: The name of the method to remove.\n        " #NEWLINE# method = getattr ( klass , methodName , None ) #NEWLINE# if ( method is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# for base in getmro ( klass ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# delattr ( base , methodName ) #NEWLINE# #UNINDENT# except ( AttributeError , TypeError ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . addCleanup ( setattr , base , methodName , self )