mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
bpo-38693: Prefer f-strings in importlib.resources (importlib_resources 5.0.6). (GH-26387) (#26389)
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit f6fbdb90ee
)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
78a8428548
commit
97b4576f65
6 changed files with 10 additions and 12 deletions
|
@ -94,16 +94,15 @@ class MultiplexedPath(abc.Traversable):
|
|||
__truediv__ = joinpath
|
||||
|
||||
def open(self, *args, **kwargs):
|
||||
raise FileNotFoundError('{} is not a file'.format(self))
|
||||
raise FileNotFoundError(f'{self} is not a file')
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._paths[0].name
|
||||
|
||||
def __repr__(self):
|
||||
return 'MultiplexedPath({})'.format(
|
||||
', '.join("'{}'".format(path) for path in self._paths)
|
||||
)
|
||||
paths = ', '.join(f"'{path}'" for path in self._paths)
|
||||
return f'MultiplexedPath({paths})'
|
||||
|
||||
|
||||
class NamespaceReader(abc.TraversableResources):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue