mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00: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:
parent
b2950686a7
commit
0498017bf0
@ -225,12 +225,12 @@ class ApkInfo(object):
|
|||||||
|
|
||||||
xml_tree = xml.etree.ElementTree.fromstring(dump)
|
xml_tree = xml.etree.ElementTree.fromstring(dump)
|
||||||
|
|
||||||
package = next(i for i in xml_tree.iter('package')
|
package = next((i for i in xml_tree.iter('package')
|
||||||
if i.attrib['name'] == self.package)
|
if i.attrib['name'] == self.package), None)
|
||||||
|
|
||||||
self._methods = [(meth.attrib['name'], klass.attrib['name'])
|
self._methods = [(meth.attrib['name'], klass.attrib['name'])
|
||||||
for klass in package.iter('class')
|
for klass in package.iter('class')
|
||||||
for meth in klass.iter('method')]
|
for meth in klass.iter('method')] if package else []
|
||||||
return self._methods
|
return self._methods
|
||||||
|
|
||||||
def _run(self, command):
|
def _run(self, command):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user