Add suggestion on MemoryError to use external 7z

This commit is contained in:
David Dalcino
2021-10-29 10:55:30 -07:00
parent dfda24d233
commit 173fbb9b6b
2 changed files with 13 additions and 4 deletions

View File

@@ -850,14 +850,19 @@ def run_installer(archives: List[QtPackage], base_dir: str, sevenzip: Optional[s
raise CliKeyboardInterrupt("Installer halted by keyboard interrupt.") from e
except MemoryError as e:
close_worker_pool_on_exception(e)
alt_extractor_msg = (
"Please try using the '--external' flag to specify an alternate 7z extraction tool "
"(see https://aqtinstall.readthedocs.io/en/latest/cli.html#cmdoption-list-tool-external)"
)
if Settings.concurrency > 1:
docs_url = "https://aqtinstall.readthedocs.io/en/stable/configuration.html#configuration"
raise OutOfMemory(
"Out of memory when downloading and extracting archives in parallel.",
suggested_action=[f"Please reduce your 'concurrency' setting (see {docs_url})"],
suggested_action=[f"Please reduce your 'concurrency' setting (see {docs_url})", alt_extractor_msg],
) from e
raise OutOfMemory(
"Out of memory when downloading and extracting archives.", suggested_action=["Please free up more memory."]
"Out of memory when downloading and extracting archives.",
suggested_action=["Please free up more memory.", alt_extractor_msg],
)
except Exception as e:
close_worker_pool_on_exception(e)

View File

@@ -614,7 +614,9 @@ def test_install_nonexistent_archives(monkeypatch, capsys, cmd, xml_file: Option
"Out of memory when downloading and extracting archives in parallel.\n"
"==============================Suggested follow-up:==============================\n"
"* Please reduce your 'concurrency' setting (see "
"https://aqtinstall.readthedocs.io/en/stable/configuration.html#configuration)",
"https://aqtinstall.readthedocs.io/en/stable/configuration.html#configuration)\n"
"* Please try using the '--external' flag to specify an alternate 7z extraction tool "
"(see https://aqtinstall.readthedocs.io/en/latest/cli.html#cmdoption-list-tool-external)",
1,
),
(
@@ -623,7 +625,9 @@ def test_install_nonexistent_archives(monkeypatch, capsys, cmd, xml_file: Option
"Caught MemoryError, terminating installer workers\n"
"Out of memory when downloading and extracting archives.\n"
"==============================Suggested follow-up:==============================\n"
"* Please free up more memory.",
"* Please free up more memory.\n"
"* Please try using the '--external' flag to specify an alternate 7z extraction tool "
"(see https://aqtinstall.readthedocs.io/en/latest/cli.html#cmdoption-list-tool-external)",
1,
),
),