Skip to content

Commit

Permalink
Fixes black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel FORESTIER committed Jun 2, 2022
1 parent 3b4f774 commit 568cce4
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/distro/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,15 +1110,12 @@ def __resolve_chroot_symlink_as_needed(self, link_location: str) -> str:
try:
resolved = os.readlink(link_location)
except OSError: # includes case "not a symlink"
if (
os.path.commonprefix(
[
os.path.realpath(self.root_dir),
os.path.realpath(link_location),
]
)
!= os.path.realpath(self.root_dir)
):
if os.path.commonprefix(
[
os.path.realpath(self.root_dir),
os.path.realpath(link_location),
]
) != os.path.realpath(self.root_dir):
# `link_location` resolves outside of `self.root_dir`.
raise FileNotFoundError from None

Expand Down

0 comments on commit 568cce4

Please sign in to comment.