1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01:00

utils/apkinfo: Fix handing when no methods defined

Not all apks list their class methods so add handling of this
situation.
This commit is contained in:
Marc Bonnici 2020-09-09 18:50:49 +01:00
parent b2950686a7
commit 0498017bf0

View File

@ -225,12 +225,12 @@ class ApkInfo(object):
xml_tree = xml.etree.ElementTree.fromstring(dump)
package = next(i for i in xml_tree.iter('package')
if i.attrib['name'] == self.package)
package = next((i for i in xml_tree.iter('package')
if i.attrib['name'] == self.package), None)
self._methods = [(meth.attrib['name'], klass.attrib['name'])
for klass in package.iter('class')
for meth in klass.iter('method')]
for meth in klass.iter('method')] if package else []
return self._methods
def _run(self, command):