Handle with invalid manifests better

In other words, don't blow up and kill a whole checkupdates run just
because one version of one package has some invalid xml.
This commit is contained in:
Ciaran Gultnieks 2016-01-26 22:00:00 +00:00
parent 5952c46bd0
commit f6b9e46246

View file

@ -1072,6 +1072,7 @@ def parse_androidmanifests(paths, app):
if matches:
vercode = matches.group(1)
else:
try:
xml = parse_xml(path)
if "package" in xml.attrib:
s = xml.attrib["package"].encode('utf-8')
@ -1085,6 +1086,8 @@ def parse_androidmanifests(paths, app):
a = xml.attrib["{http://schemas.android.com/apk/res/android}versionCode"].encode('utf-8')
if string_is_integer(a):
vercode = a
except Exception:
logging.warning("Problem with xml at {0}".format(path))
# Remember package name, may be defined separately from version+vercode
if package is None: