Skip to content

Commit b68509f

Browse files
committed
👹 Feed the hobgoblins (delint).
1 parent d93e241 commit b68509f

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

‎importlib_resources/readers.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ def _candidate_paths(cls, path_str):
156156
def _resolve_zip_path(path_str):
157157
for match in reversed(list(re.finditer(r'[\\/]', path_str))):
158158
with contextlib.suppress(
159-
FileNotFoundError, IsADirectoryError, NotADirectoryError, PermissionError
159+
FileNotFoundError,
160+
IsADirectoryError,
161+
NotADirectoryError,
162+
PermissionError,
160163
):
161164
inner = path_str[match.end() :].replace('\\', '/') + '/'
162165
yield ZipPath(path_str[: match.start()], inner.lstrip('/'))

‎importlib_resources/tests/test_read.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def test_read_submodule_resource(self):
8686

8787
def test_read_submodule_resource_by_name(self):
8888
result = (
89-
resources.files('namespacedata01.subdirectory').joinpath('binary.file').read_bytes()
89+
resources.files('namespacedata01.subdirectory')
90+
.joinpath('binary.file')
91+
.read_bytes()
9092
)
9193
self.assertEqual(result, b'\0\1\2\3')
9294

‎importlib_resources/tests/test_reader.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def test_iterdir(self):
2626
contents.remove('__pycache__')
2727
except (KeyError, ValueError):
2828
pass
29-
self.assertEqual(contents, {'subdirectory', 'binary.file', 'utf-16.file', 'utf-8.file'})
29+
self.assertEqual(
30+
contents, {'subdirectory', 'binary.file', 'utf-16.file', 'utf-8.file'}
31+
)
3032

3133
def test_iterdir_duplicate(self):
3234
data01 = pathlib.Path(__file__).parent.joinpath('data01')

‎importlib_resources/tests/test_resource.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,19 @@ def test_submodule_contents(self):
186186
contents.remove('__pycache__')
187187
except KeyError:
188188
pass
189-
self.assertEqual(contents, {'subdirectory', 'binary.file', 'utf-8.file', 'utf-16.file'})
189+
self.assertEqual(
190+
contents, {'subdirectory', 'binary.file', 'utf-8.file', 'utf-16.file'}
191+
)
190192

191193
def test_submodule_contents_by_name(self):
192194
contents = names(resources.files('namespacedata01'))
193195
try:
194196
contents.remove('__pycache__')
195197
except KeyError:
196198
pass
197-
self.assertEqual(contents, {'subdirectory', 'binary.file', 'utf-8.file', 'utf-16.file'})
199+
self.assertEqual(
200+
contents, {'subdirectory', 'binary.file', 'utf-8.file', 'utf-16.file'}
201+
)
198202

199203
def test_submodule_sub_contents(self):
200204
contents = names(resources.files(import_module('namespacedata01.subdirectory')))

0 commit comments

Comments
 (0)