diff options
-rw-r--r-- | sleekxmpp/xmlstream/stanzabase.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index fb8e6bee..dfa37368 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -254,8 +254,9 @@ class ElementBase(object): """ if attrib in self.interfaces: if value is not None: - if hasattr(self, "set%s" % attrib.title()): - getattr(self, "set%s" % attrib.title())(value,) + set_method = "set%s" % attrib.title() + if hasattr(self, set_method): + getattr(self, set_method)(value,) else: if attrib in self.sub_interfaces: return self._setSubText(attrib, text=value) |