Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
518b6993
Unverified
Commit
518b6993
authored
Apr 06, 2020
by
finswimmer
Committed by
GitHub
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils: fallback to env var when detecting shell (#2147)
Resolves: #2115
parent
f76ceee0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
poetry/utils/shell.py
+12
-1
No files found.
poetry/utils/shell.py
View file @
518b6993
...
...
@@ -9,6 +9,7 @@ from shellingham import ShellDetectionFailure
from
shellingham
import
detect_shell
from
._compat
import
WINDOWS
from
._compat
import
Path
from
.env
import
VirtualEnv
...
...
@@ -42,7 +43,17 @@ class Shell:
try
:
name
,
path
=
detect_shell
(
os
.
getpid
())
except
(
RuntimeError
,
ShellDetectionFailure
):
raise
RuntimeError
(
"Unable to detect the current shell."
)
shell
=
None
if
os
.
name
==
"posix"
:
shell
=
os
.
environ
.
get
(
"SHELL"
)
elif
os
.
name
==
"nt"
:
shell
=
os
.
environ
.
get
(
"COMSPEC"
)
if
not
shell
:
raise
RuntimeError
(
"Unable to detect the current shell."
)
name
,
path
=
Path
(
shell
)
.
stem
,
shell
cls
.
_shell
=
cls
(
name
,
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment