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
aaf88062
Commit
aaf88062
authored
Nov 14, 2021
by
Branch Vincent
Committed by
Bjorn Neergaard
Nov 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove unused compatibility code
parent
d4c2fe44
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
25 deletions
+2
-25
src/poetry/installation/executor.py
+1
-1
src/poetry/utils/appdirs.py
+0
-18
src/poetry/utils/helpers.py
+1
-6
No files found.
src/poetry/installation/executor.py
View file @
aaf88062
...
@@ -660,7 +660,7 @@ class Executor:
...
@@ -660,7 +660,7 @@ class Executor:
cache_directory
=
self
.
_chef
.
get_cache_directory_for_link
(
link
)
cache_directory
=
self
.
_chef
.
get_cache_directory_for_link
(
link
)
cached_file
=
cache_directory
.
joinpath
(
link
.
filename
)
cached_file
=
cache_directory
.
joinpath
(
link
.
filename
)
# We can't use unlink(missing_ok=True) because it's not available
# We can't use unlink(missing_ok=True) because it's not available
#
in pathlib2 for Python 2.7
#
prior to Python 3.8
if
cached_file
.
exists
():
if
cached_file
.
exists
():
cached_file
.
unlink
()
cached_file
.
unlink
()
...
...
src/poetry/utils/appdirs.py
View file @
aaf88062
...
@@ -240,21 +240,3 @@ if WINDOWS:
...
@@ -240,21 +240,3 @@ if WINDOWS:
_get_win_folder
=
_get_win_folder_with_ctypes
_get_win_folder
=
_get_win_folder_with_ctypes
except
ImportError
:
except
ImportError
:
_get_win_folder
=
_get_win_folder_from_registry
_get_win_folder
=
_get_win_folder_from_registry
def
_win_path_to_bytes
(
path
:
str
)
->
Union
[
str
,
bytes
]:
"""Encode Windows paths to bytes. Only used on Python 2.
Motivation is to be consistent with other operating systems where paths
are also returned as bytes. This avoids problems mixing bytes and Unicode
elsewhere in the codebase. For more details and discussion see
<https://github.com/pypa/pip/issues/3463>.
If encoding using ASCII and MBCS fails, return the original Unicode path.
"""
for
encoding
in
(
"ASCII"
,
"MBCS"
):
try
:
return
path
.
encode
(
encoding
)
except
(
UnicodeEncodeError
,
LookupError
):
pass
return
path
src/poetry/utils/helpers.py
View file @
aaf88062
...
@@ -4,6 +4,7 @@ import shutil
...
@@ -4,6 +4,7 @@ import shutil
import
stat
import
stat
import
tempfile
import
tempfile
from
collections.abc
import
Mapping
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
TYPE_CHECKING
from
typing
import
TYPE_CHECKING
...
@@ -17,12 +18,6 @@ from typing import Optional
...
@@ -17,12 +18,6 @@ from typing import Optional
from
poetry.config.config
import
Config
from
poetry.config.config
import
Config
try
:
from
collections.abc
import
Mapping
except
ImportError
:
from
collections
import
Mapping
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
requests
import
Session
from
requests
import
Session
...
...
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