2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 15:53:36 +00:00

Fixing infinite recursion bug with object inheritance

This change removes all references to self.__class__. In object
hierarchies with multiple levels of inheritance, using self.__class__
can cause an infinite loop when resolving references to parent classes.
This commit is contained in:
Peter Hamilton
2015-06-02 11:16:42 -04:00
parent f57273fcc5
commit ab3298c6d1
14 changed files with 219 additions and 205 deletions

View File

@@ -89,7 +89,7 @@ class KMIP(object):
class KMIPImpl(KMIP):
def __init__(self):
super(self.__class__, self).__init__()
super(KMIPImpl, self).__init__()
self.logger = logging.getLogger(__name__)
self.key_factory = KeyFactory()
self.secret_factory = SecretFactory()
@@ -393,5 +393,5 @@ class KMIPImpl(KMIP):
class InvalidFieldException(Exception):
def __init__(self, result):
super(self.__class__, self).__init__()
super(InvalidFieldException, self).__init__()
self.result = result