Skip to content

Commit

Permalink
Convert absolute import path to relative for better compatibility. (#…
Browse files Browse the repository at this point in the history
…3040)

Follow-up to gh-3036 to fix "mamba clean".
ref:
- #3033 (comment)

Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull authored Dec 6, 2023
1 parent 4a6bb95 commit cf9c063
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mamba/mamba/mamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ def clean(args, parser):
from importlib import import_module

relative_mod, func_name = args.func.rsplit(".", 1)
# make module relative following https://github.com/conda/conda/pull/13173
if relative_mod.startswith("conda.cli."):
relative_mod = f'.{relative_mod.split(".")[-1]}'

module = import_module("conda.cli" + relative_mod, __name__.rsplit(".", 1)[0])
exit_code = getattr(module, func_name)(args, parser)
Expand Down

0 comments on commit cf9c063

Please sign in to comment.