File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,10 @@ def is_file(self):
85
85
def joinpath (self , * descendants ):
86
86
try :
87
87
return super ().joinpath (* descendants )
88
- except abc .TraversalError as exc :
89
- # One of the paths didn't resolve.
90
- msg , target , names = exc .args
91
- if names : # pragma: nocover
92
- raise
93
- # It was the last; construct result with the first path.
94
- return self ._paths [0 ].joinpath (target )
88
+ except abc .TraversalError :
89
+ # One of the paths did not resolve (a directory does not exist).
90
+ # Just return something that will not exist.
91
+ return self ._paths [0 ].joinpath (* descendants )
95
92
96
93
def open (self , * args , ** kwargs ):
97
94
raise FileNotFoundError (f'{ self } is not a file' )
Original file line number Diff line number Diff line change 3
3
import pathlib
4
4
import unittest
5
5
6
- import pytest
7
-
8
6
from importlib import import_module
9
7
from importlib_resources .readers import MultiplexedPath , NamespaceReader
10
8
@@ -79,7 +77,6 @@ def test_join_path(self):
79
77
)
80
78
self .assertEqual (path .joinpath (), path )
81
79
82
- @pytest .mark .xfail (reason = "#253" )
83
80
def test_join_path_compound (self ):
84
81
path = MultiplexedPath (self .folder )
85
82
assert not path .joinpath ('imaginary/foo.py' ).exists ()
You can’t perform that action at this time.
0 commit comments