Mercurial > libervia-backend
diff src/plugins/plugin_xep_0277.py @ 660:69a8bfd266a5
core, plugins: fixed bad use of children instead of elements() for domish.Element instances.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 15 Oct 2013 19:28:34 +0200 |
parents | 47d3a22b4629 |
children | 3c304929af74 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py Mon Oct 07 13:09:57 2013 +0200 +++ b/src/plugins/plugin_xep_0277.py Tue Oct 15 19:28:34 2013 +0200 @@ -85,8 +85,8 @@ @param item: domish.Element of microblog item @return: microblog data (dictionary)""" try: - entry_elt = filter(lambda x: x.name == "entry", item.children)[0] - except KeyError: + entry_elt = [child for child in item.elements() if child.name == "entry"][0] + except IndexError: warning(_('No entry element in microblog item')) return _entry = atom.Entry().import_xml(entry_elt.toXml().encode('utf-8'))