From 04145146d7f71df62d96954bf0d97b1ccfa09e13 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 4 Dec 2022 15:12:46 +0000 Subject: [PATCH] update.py: Finaly mypy pass * It's possible the `xml` code could be changed to make types work. But the code works, ignore types on those calls. --- update.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/update.py b/update.py index a44f4426..bbd65ab2 100644 --- a/update.py +++ b/update.py @@ -185,8 +185,11 @@ class Updater(object): sparkle_platform = 'windows' for item in feed.findall('channel/item'): - ver = item.find('enclosure').attrib.get('{http://www.andymatuschak.org/xml-namespaces/sparkle}version') - ver_platform = item.find('enclosure').attrib.get( + # xml is a pain with types, hence these ignores + ver = item.find('enclosure').attrib.get( # type: ignore + '{http://www.andymatuschak.org/xml-namespaces/sparkle}version' + ) + ver_platform = item.find('enclosure').attrib.get( # type: ignore '{http://www.andymatuschak.org/xml-namespaces/sparkle}os' ) if ver_platform != sparkle_platform: @@ -196,8 +199,8 @@ class Updater(object): sv = semantic_version.Version.coerce(ver) items[sv] = EDMCVersion( - version=ver, # sv might have mangled version - title=item.find('title').text, + version=str(ver), # sv might have mangled version + title=item.find('title').text, # type: ignore sv=sv )