Skip to content

Commit

Permalink
Convert Path objects into str in indentify_conda_exe
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoesters committed Sep 20, 2024
1 parent 25b97b0 commit 5e46fd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions constructor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
from io import StringIO
from os import environ, sep, unlink
from os.path import isdir, isfile, islink, join, normpath
from pathlib import Path
from shutil import rmtree
from subprocess import CalledProcessError, check_call, check_output
from typing import Tuple
from typing import Tuple, Union

from ruamel.yaml import YAML

Expand Down Expand Up @@ -257,9 +258,11 @@ def approx_size_kb(info, which="pkgs"):
return int(math.ceil(size_bytes/1000))


def identify_conda_exe(conda_exe=None) -> Tuple[StandaloneExe, str]:
def identify_conda_exe(conda_exe: Union[str, Path] = None) -> Tuple[StandaloneExe, str]:
if conda_exe is None:
conda_exe = normalize_path(join(sys.prefix, "standalone_conda", "conda.exe"))
if isinstance(conda_exe, Path):
conda_exe = str(conda_exe)
try:
output_version = check_output([conda_exe, "--version"], text=True)
output_version = output_version.strip()
Expand Down

0 comments on commit 5e46fd1

Please sign in to comment.