File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/poetry/console/commands/env Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -27,19 +27,20 @@ def handle(self) -> int:
2727
2828 env = EnvManager (self .poetry ).get ()
2929
30- if command := self ._get_activate_command (env ):
31- self .line (command )
32- return 0
33- else :
34- raise ShellNotSupportedError (
35- "Discovered shell doesn't have an activator in virtual environment"
36- )
37-
38- def _get_activate_command (self , env : Env ) -> str :
3930 try :
4031 shell , _ = shellingham .detect_shell ()
4132 except shellingham .ShellDetectionFailure :
4233 shell = ""
34+
35+ if command := self ._get_activate_command (env , shell ):
36+ self .line (command )
37+ return 0
38+
39+ raise ShellNotSupportedError (
40+ f"Discovered shell '{ shell } ' doesn't have an activator in virtual environment"
41+ )
42+
43+ def _get_activate_command (self , env : Env , shell : str ) -> str :
4344 if shell == "fish" :
4445 command , filename = "source" , "activate.fish"
4546 elif shell == "nu" :
You can’t perform that action at this time.
0 commit comments