Skip to content

Commit

Permalink
MAINT: Use log over print
Browse files Browse the repository at this point in the history
Also do not attempt to print errors
  • Loading branch information
HaoZeke committed Nov 23, 2024
1 parent 903885e commit 9864bac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions asv/plugins/_mamba_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(),
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9864bac

Please sign in to comment.