some style things

This commit is contained in:
kshea21 2025-02-11 15:16:19 -08:00 committed by Gregory Becker
parent 1e5e416df0
commit 57a5722ba7
No known key found for this signature in database
GPG Key ID: 2362541F6D14ED84
3 changed files with 4 additions and 6 deletions

View File

@ -38,6 +38,7 @@
import os import os
import re import re
import signal import signal
import stat
import sys import sys
import traceback import traceback
import types import types

View File

@ -1131,7 +1131,7 @@ def install_action(self: "Task") -> InstallAction:
# If the install prefix is missing, warn about it, and proceed with # If the install prefix is missing, warn about it, and proceed with
# normal install. # normal install.
if not os.path.exists(task.pkg.prefix): if not os.path.exists(self.pkg.prefix):
tty.debug("Missing installation to overwrite") tty.debug("Missing installation to overwrite")
return InstallAction.INSTALL return InstallAction.INSTALL
@ -1276,9 +1276,6 @@ def complete(self):
assert ( assert (
self.started or self.no_op self.started or self.no_op
), "Can't call `complete()` before `start()` or identified no-operation task" ), "Can't call `complete()` before `start()` or identified no-operation task"
# seeing if I can get rid of that assertion because in some cases we will need to
# complete the task so that we can raise the errors even though a process was never
# started because saving the error made it exit the function before a process could be started
install_args = self.request.install_args install_args = self.request.install_args
pkg = self.pkg pkg = self.pkg
tests = install_args.get("tests") tests = install_args.get("tests")
@ -2350,7 +2347,7 @@ def install(self) -> None:
failure = self.complete_task(task, install_status) failure = self.complete_task(task, install_status)
if failure: if failure:
failed_build_requests.append(failure) failed_build_requests.append(failure)
except: except Exception as e:
# Terminate any active child processes if there's an installation error # Terminate any active child processes if there's an installation error
for task in active_tasks: for task in active_tasks:
if task.process_handle is not None: if task.process_handle is not None:

View File

@ -727,7 +727,7 @@ def test_installing_task_use_cache(install_mockery, monkeypatch):
task = create_build_task(request.pkg) task = create_build_task(request.pkg)
monkeypatch.setattr(inst, "_install_from_cache", _true) monkeypatch.setattr(inst, "_install_from_cache", _true)
installer.install() installer.start_task(task, , None)
assert request.pkg_id in installer.installed assert request.pkg_id in installer.installed