Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle compatibility issues in build includes #75

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion poetry/core/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,17 @@ def __init__(
self.path = Path(path)
self.source_root = None if not source_root else Path(source_root).resolve()
if not self.path.is_absolute() and self.source_root:
self.path = (self.source_root / self.path).resolve()
self.path = self.source_root / self.path
else:
self.path = self.path

try:
self.path = self.path.resolve()
except FileNotFoundError:
# this is an issue in in python 3.5, since resolve uses strict=True by
# default, this workaround needs to be maintained till python 2.7 and
# python 3.5 are dropped, until we can use resolve(strict=False).
pass

def __eq__(self, other): # type: (Union[BuildIncludeFile, Path]) -> bool
if hasattr(other, "path"):
Expand Down
6 changes: 6 additions & 0 deletions poetry/core/utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
OrderedDict = dict


try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError # noqa


def decode(string, encodings=None):
if not PY2 and not isinstance(string, bytes):
return string
Expand Down