Skip to content

Commit 935dda6

Browse files
committed
Handle compatibility issues in build includes
1 parent fd4378e commit 935dda6

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

poetry/core/masonry/builders/builder.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,17 @@ def __init__(
314314
self.path = Path(path)
315315
self.source_root = None if not source_root else Path(source_root).resolve()
316316
if not self.path.is_absolute() and self.source_root:
317-
self.path = (self.source_root / self.path).resolve()
317+
self.path = self.source_root / self.path
318318
else:
319+
self.path = self.path
320+
321+
try:
319322
self.path = self.path.resolve()
323+
except FileNotFoundError:
324+
# this is an issue in in python 3.5, since resolve uses strict=True by
325+
# default, this workaround needs to be maintained till python 2.7 and
326+
# python 3.5 are dropped, until we can use resolve(strict=False).
327+
pass
320328

321329
def __eq__(self, other): # type: (Union[BuildIncludeFile, Path]) -> bool
322330
if hasattr(other, "path"):

poetry/core/utils/_compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
OrderedDict = dict
4545

4646

47+
try:
48+
FileNotFoundError
49+
except NameError:
50+
FileNotFoundError = IOError # noqa
51+
52+
4753
def decode(string, encodings=None):
4854
if not PY2 and not isinstance(string, bytes):
4955
return string

0 commit comments

Comments
 (0)