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
…3036)

Fix #3033 and #2994.
  • Loading branch information
jezdez authored Dec 5, 2023
1 parent 34ce523 commit 640aada
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mamba/mamba/mamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ def clean(args, parser):
def do_call(args, parser):
if hasattr(args, "func"):
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]}'
elif hasattr(args, "_plugin_subcommand"):
action = args._plugin_subcommand.action
relative_mod = f'.{action.__module__.split(".")[-1]}'
Expand Down Expand Up @@ -763,7 +766,7 @@ def format_param(nm, val):
exit_code = update(args, parser)
elif relative_mod == ".main_init":
exit_code = shell_init(args)
elif relative_mod == ".main_repoquery":
elif relative_mod in (".main_repoquery", "repoquery"):
exit_code = repoquery(args, parser)
else:
print(
Expand Down

0 comments on commit 640aada

Please sign in to comment.