Remap old method names in a better way.
This should prevent some reference cycles that will cause garbage collection issues.
This commit is contained in:
@@ -75,13 +75,6 @@ class Iq(RootStanza):
|
||||
Overrides StanzaBase.__init__.
|
||||
"""
|
||||
StanzaBase.__init__(self, *args, **kwargs)
|
||||
# To comply with PEP8, method names now use underscores.
|
||||
# Deprecated method names are re-mapped for backwards compatibility.
|
||||
self.setPayload = self.set_payload
|
||||
self.getQuery = self.get_query
|
||||
self.setQuery = self.set_query
|
||||
self.delQuery = self.del_query
|
||||
|
||||
if self['id'] == '':
|
||||
if self.stream is not None:
|
||||
self['id'] = self.stream.getNewId()
|
||||
@@ -229,3 +222,11 @@ class Iq(RootStanza):
|
||||
else:
|
||||
StanzaBase._set_stanza_values(self, values)
|
||||
return self
|
||||
|
||||
|
||||
# To comply with PEP8, method names now use underscores.
|
||||
# Deprecated method names are re-mapped for backwards compatibility.
|
||||
Iq.setPayload = Iq.set_payload
|
||||
Iq.getQuery = Iq.get_query
|
||||
Iq.setQuery = Iq.set_query
|
||||
Iq.delQuery = Iq.del_query
|
||||
|
Reference in New Issue
Block a user