mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	Reduce try/except block
This commit is contained in:
		
							parent
							
								
									1151ba298f
								
							
						
					
					
						commit
						7e1d974351
					
				
					 1 changed files with 13 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -1846,20 +1846,21 @@ def parse_androidmanifests(paths, app):
 | 
			
		|||
        else:
 | 
			
		||||
            try:
 | 
			
		||||
                xml = parse_xml(path)
 | 
			
		||||
                if "package" in xml.attrib:
 | 
			
		||||
                    s = xml.attrib["package"]
 | 
			
		||||
                    if app_matches_packagename(app, s):
 | 
			
		||||
                        package = s
 | 
			
		||||
                if XMLNS_ANDROID + "versionName" in xml.attrib:
 | 
			
		||||
                    version = xml.attrib[XMLNS_ANDROID + "versionName"]
 | 
			
		||||
                    base_dir = os.path.dirname(path)
 | 
			
		||||
                    version = retrieve_string_singleline(base_dir, version)
 | 
			
		||||
                if XMLNS_ANDROID + "versionCode" in xml.attrib:
 | 
			
		||||
                    a = xml.attrib[XMLNS_ANDROID + "versionCode"]
 | 
			
		||||
                    if string_is_integer(a):
 | 
			
		||||
                        vercode = a
 | 
			
		||||
            except Exception:
 | 
			
		||||
                logging.warning(_("Problem with xml at '{path}'").format(path=path))
 | 
			
		||||
                continue
 | 
			
		||||
            if "package" in xml.attrib:
 | 
			
		||||
                s = xml.attrib["package"]
 | 
			
		||||
                if app_matches_packagename(app, s):
 | 
			
		||||
                    package = s
 | 
			
		||||
            if XMLNS_ANDROID + "versionName" in xml.attrib:
 | 
			
		||||
                version = xml.attrib[XMLNS_ANDROID + "versionName"]
 | 
			
		||||
                base_dir = os.path.dirname(path)
 | 
			
		||||
                version = retrieve_string_singleline(base_dir, version)
 | 
			
		||||
            if XMLNS_ANDROID + "versionCode" in xml.attrib:
 | 
			
		||||
                a = xml.attrib[XMLNS_ANDROID + "versionCode"]
 | 
			
		||||
                if string_is_integer(a):
 | 
			
		||||
                    vercode = a
 | 
			
		||||
 | 
			
		||||
        # Remember package name, may be defined separately from version+vercode
 | 
			
		||||
        if package is None:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue