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
73bc4eb1
Unverified
Commit
73bc4eb1
authored
May 16, 2023
by
Branch Vincent
Committed by
GitHub
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: subprocess doesn't allow Path on windows, 3.7 (#7932)
parent
3f2469ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
src/poetry/utils/env.py
+4
-4
tests/utils/test_env.py
+1
-0
No files found.
src/poetry/utils/env.py
View file @
73bc4eb1
...
@@ -544,7 +544,7 @@ class EnvManager:
...
@@ -544,7 +544,7 @@ class EnvManager:
if
executable
:
if
executable
:
python_patch
=
decode
(
python_patch
=
decode
(
subprocess
.
check_output
(
subprocess
.
check_output
(
[
executable
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
[
str
(
executable
)
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
)
.
strip
()
)
.
strip
()
)
)
...
@@ -579,7 +579,7 @@ class EnvManager:
...
@@ -579,7 +579,7 @@ class EnvManager:
try
:
try
:
python_version_string
=
decode
(
python_version_string
=
decode
(
subprocess
.
check_output
(
subprocess
.
check_output
(
[
python_path
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
[
str
(
python_path
)
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
)
)
)
)
except
CalledProcessError
as
e
:
except
CalledProcessError
as
e
:
...
@@ -906,7 +906,7 @@ class EnvManager:
...
@@ -906,7 +906,7 @@ class EnvManager:
if
executable
:
if
executable
:
python_patch
=
decode
(
python_patch
=
decode
(
subprocess
.
check_output
(
subprocess
.
check_output
(
[
executable
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
[
str
(
executable
)
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
)
.
strip
()
)
.
strip
()
)
)
python_minor
=
"."
.
join
(
python_patch
.
split
(
"."
)[:
2
])
python_minor
=
"."
.
join
(
python_patch
.
split
(
"."
)[:
2
])
...
@@ -954,7 +954,7 @@ class EnvManager:
...
@@ -954,7 +954,7 @@ class EnvManager:
try
:
try
:
python_patch
=
decode
(
python_patch
=
decode
(
subprocess
.
check_output
(
subprocess
.
check_output
(
[
python
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
[
str
(
python
)
,
"-c"
,
GET_PYTHON_VERSION_ONELINER
],
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
)
.
strip
()
)
.
strip
()
)
)
...
...
tests/utils/test_env.py
View file @
73bc4eb1
...
@@ -192,6 +192,7 @@ def check_output_wrapper(
...
@@ -192,6 +192,7 @@ def check_output_wrapper(
)
->
Callable
[[
list
[
str
],
Any
,
Any
],
str
]:
)
->
Callable
[[
list
[
str
],
Any
,
Any
],
str
]:
def
check_output
(
cmd
:
list
[
str
],
*
args
:
Any
,
**
kwargs
:
Any
)
->
str
:
def
check_output
(
cmd
:
list
[
str
],
*
args
:
Any
,
**
kwargs
:
Any
)
->
str
:
# cmd is a list, like ["python", "-c", "do stuff"]
# cmd is a list, like ["python", "-c", "do stuff"]
assert
all
(
isinstance
(
arg
,
str
)
for
arg
in
cmd
)
python_cmd
=
cmd
[
2
]
python_cmd
=
cmd
[
2
]
if
"sys.version_info[:3]"
in
python_cmd
:
if
"sys.version_info[:3]"
in
python_cmd
:
return
version
.
text
return
version
.
text
...
...
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