From 345656926ea5ee8e8cc359b97fd1d0cbc4b1fab4 Mon Sep 17 00:00:00 2001 From: fritzy Date: Sat, 21 Aug 2010 22:48:43 +0000 Subject: added form compatibility with old api, stanzas now bool() to True on 2.x, jid attributes will return '' if not set --- sleekxmpp/xmlstream/stanzabase.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/xmlstream/stanzabase.py') diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 3223901a..7458f3c7 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -362,7 +362,10 @@ class ElementBase(object): self.idx = 0 return self - def __bool__(self): + def __bool__(self): #python 3.x + return True + + def __nonzero__(self): #python 2.x return True def __next__(self): -- cgit v1.2.3