Skip to content

Commit

Permalink
Small #TODO cleanups (#9284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus authored Apr 8, 2024
1 parent 925424a commit 0d7604a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/poetry/masonry/builders/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ def _add_pth(self) -> list[Path]:
f" {self._poetry.file.path.parent}"
)
return [pth_file]
except OSError:
# TODO: Replace with PermissionError
except PermissionError:
self._io.write_error_line(
f" - Failed to create <c2>{pth_file.name}</c2> for"
f" {self._poetry.file.path.parent}"
Expand Down
5 changes: 1 addition & 4 deletions src/poetry/utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@
from pathlib import Path


# TODO: use try/except ImportError when
# https://github.com/python/mypy/issues/1393 is fixed

if sys.version_info < (3, 11):
# compatibility for python <3.11
import tomli as tomllib
else:
import tomllib # nopycln: import
import tomllib


if sys.version_info < (3, 10):
Expand Down
5 changes: 1 addition & 4 deletions src/poetry/utils/env/site_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,11 @@ def _path_method_wrapper(
results = []

for candidate in candidates:
try:
with contextlib.suppress(OSError):
result = candidate, getattr(candidate, method)(*args, **kwargs)
if return_first:
return result
results.append(result)
except OSError:
# TODO: Replace with PermissionError
pass

if results:
return results
Expand Down

0 comments on commit 0d7604a

Please sign in to comment.