mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +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:
		@@ -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):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user