Skip to content

Commit d232315

Browse files
committed
🐛 fix environment detection issue
1 parent 7ef5136 commit d232315

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

nb_cli/handlers/environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from typing import IO, TYPE_CHECKING, Any, Union, Literal, ClassVar, TypeAlias, overload
77

88
import click
9-
from packaging.requirements import Requirement
10-
11-
from nb_cli import _
129
from nb_cli.consts import WINDOWS
1310
from nb_cli.cli.utils import run_sync
11+
from packaging.requirements import Requirement
1412
from nb_cli.exceptions import ProcessExecutionError
13+
14+
from nb_cli import _
1515
from nb_cli.config import GLOBAL_CONFIG, ConfigManager
1616

1717
from .process import create_process
@@ -52,7 +52,7 @@ def probe_environment_manager(*, cwd: Path | None = None) -> tuple[str, str]:
5252
"pip",
5353
)
5454

55-
available = next(iter(m for m in [current, "pip"] if which(m) is not None))
55+
available = current if which(current) is not None else "pip"
5656

5757
return current, available
5858

0 commit comments

Comments
 (0)