Skip to content

Commit

Permalink
Fix: variable become undefined when extension not exist or connection…
Browse files Browse the repository at this point in the history
… error

- Fixed the issue #867

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Dec 24, 2024
1 parent f914397 commit 690f798
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,16 @@ 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)

def _download_update_xml(self, update_xml_path, silent=False):
def _download_update_xml(self, update_xml_path, silent=False) -> str:
"""Hook for unit test."""
if not Settings.ignore_hash:
try:
Expand Down

0 comments on commit 690f798

Please sign in to comment.