From 98fda2ebaf68baf558101c3cf1c2ba00c69bfa14 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Tue, 24 Dec 2024 12:08:37 +0900 Subject: [PATCH] Fix: variable become undefined when extension not exist or connection error - Fixed the issue #867 Signed-off-by: Hiroshi Miura --- aqt/archives.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aqt/archives.py b/aqt/archives.py index a0b487ef..be9d5494 100644 --- a/aqt/archives.py +++ b/aqt/archives.py @@ -442,11 +442,12 @@ def _get_archives_base(self, name, target_packages): try: extensions_xml_text = self._download_update_xml(extensions_xml_url, True) except ArchiveDownloadError: - # In case _download_update_xml ignores the hash and tries to get the url. + # In case _download_update_xml failed to get the url because of no extension. pass - if extensions_xml_text: - self.logger.info("Found extension {}".format(ext)) - update_xmls.append(UpdateXmls(extensions_target_folder, extensions_xml_text)) + else: + if extensions_xml_text: + self.logger.info("Found extension {}".format(ext)) + update_xmls.append(UpdateXmls(extensions_target_folder, extensions_xml_text)) self._parse_update_xmls(update_xmls, target_packages)