From 95d2614f2197e56b4c2d73f1453e7c772efcd64c Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 24 Mar 2010 16:03:16 -0700 Subject: [PATCH] fix for bug #18 --- sleekxmpp/xmlstream/stanzabase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 7a5ba4a1..a0a3a337 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -44,7 +44,6 @@ class ElementBase(tostring.ToString): subitem = None def __init__(self, xml=None, parent=None): - self.attrib = self # backwards compatibility hack self.parent = parent self.xml = xml self.plugins = {} @@ -57,6 +56,11 @@ class ElementBase(tostring.ToString): if self.subitem is not None and child.tag == "{%s}%s" % (self.subitem.namespace, self.subitem.name): self.iterables.append(self.subitem(xml=child, parent=self)) + def _getattrib(self): + return self + + attrib = property(_getattrib) # backwards compatibility + def __iter__(self): self.idx = 0 return self