Skip to content

Commit c17a610

Browse files
committed
Merge tag 'v5.0.5' into cpython
2 parents 7169369 + a8c2ead commit c17a610

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Lib/importlib/readers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def joinpath(self, child):
9696
def open(self, *args, **kwargs):
9797
raise FileNotFoundError('{} is not a file'.format(self))
9898

99+
@property
99100
def name(self):
100101
return self._paths[0].name
101102

Lib/test/test_importlib/test_reader.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ def test_repr(self):
8282
"MultiplexedPath('{}')".format(self.folder),
8383
)
8484

85+
def test_name(self):
86+
self.assertEqual(
87+
MultiplexedPath(self.folder).name,
88+
os.path.basename(self.folder),
89+
)
90+
8591

8692
class NamespaceReaderTest(unittest.TestCase):
8793
site_dir = str(pathlib.Path(__file__).parent)

0 commit comments

Comments
 (0)