From 9864bac6e37f7a8b7c547100853adc754e0f03e0 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sat, 23 Nov 2024 17:06:42 +0000 Subject: [PATCH] MAINT: Use log over print Also do not attempt to print errors --- asv/plugins/_mamba_helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asv/plugins/_mamba_helpers.py b/asv/plugins/_mamba_helpers.py index 3b15d6bf9..869ba2ab4 100644 --- a/asv/plugins/_mamba_helpers.py +++ b/asv/plugins/_mamba_helpers.py @@ -12,6 +12,7 @@ from conda.core.index import check_allowlist from conda.gateways.connection.session import CondaHttpAuth +from ..console import log def get_index( channel_urls=(), @@ -145,12 +146,12 @@ def load_channels( continue if context.verbosity != 0 and not context.json: - print( + log.info( "Channel: {}, platform: {}, prio: {} : {}".format( entry["channel"], entry["platform"], priority, subpriority ) ) - print("Cache path: ", subdir.cache_path()) + log.info("Cache path: ", subdir.cache_path()) repo = subdir.create_repo(pool) repo.set_priority(priority, subpriority) @@ -254,8 +255,7 @@ def solve(self, specs, pkg_cache_path=None): for c in self.channels: error_string += f" - {c}\n" error_string += api_solver.explain_problems() - print(error_string) - raise RuntimeError("Solver could not find solution." + error_string) + raise RuntimeError(f"Solver could not find solution, got:\n{error_string}") if pkg_cache_path is None: # use values from conda