diff options
author | Lance Stout <lancestout@gmail.com> | 2013-02-14 01:24:09 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2013-02-14 01:24:09 -0800 |
commit | d8c96623022835dece47e499245369aa68927300 (patch) | |
tree | fe1f2604f5b90e345a74144e3fc63f782dd728e3 /sleekxmpp/plugins/xep_0004/stanza/field.py | |
parent | ec5e819b16e5326638551b80464c0c3714b3dc3c (diff) | |
download | slixmpp-d8c96623022835dece47e499245369aa68927300.tar.gz slixmpp-d8c96623022835dece47e499245369aa68927300.tar.bz2 slixmpp-d8c96623022835dece47e499245369aa68927300.tar.xz slixmpp-d8c96623022835dece47e499245369aa68927300.zip |
Resolve most Python3.3 related issues.
Tests now run successfully. Occasionally get single error related to
duplicated payload data in pubsub items when copying stanza values.
Diffstat (limited to 'sleekxmpp/plugins/xep_0004/stanza/field.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0004/stanza/field.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0004/stanza/field.py b/sleekxmpp/plugins/xep_0004/stanza/field.py index 1e175966..51f85995 100644 --- a/sleekxmpp/plugins/xep_0004/stanza/field.py +++ b/sleekxmpp/plugins/xep_0004/stanza/field.py @@ -41,10 +41,11 @@ class FormField(ElementBase): self._type = value def add_option(self, label='', value=''): - if self._type in self.option_types: - opt = FieldOption(parent=self) + if self._type is None or self._type in self.option_types: + opt = FieldOption() opt['label'] = label opt['value'] = value + self.append(opt) else: raise ValueError("Cannot add options to " + \ "a %s field." % self['type']) |