Skip to content

Commit 5fda691

Browse files
committed
fix linter errors
1 parent a28298f commit 5fda691

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

fsspec/implementations/http.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ async def _glob(self, path, maxdepth=None, **kwargs):
448448

449449
ends_with_slash = path.endswith("/") # _strip_protocol strips trailing slash
450450
path = self._strip_protocol(path)
451-
append_slash_to_dirname = ends_with_slash or path.endswith("/**") or path.endswith("/*")
451+
append_slash_to_dirname = ends_with_slash or path.endswith(("/**", "/*"))
452452
idx_star = path.find("*") if path.find("*") >= 0 else len(path)
453453
idx_brace = path.find("[") if path.find("[") >= 0 else len(path)
454454

@@ -493,7 +493,9 @@ async def _glob(self, path, maxdepth=None, **kwargs):
493493
out = {
494494
(
495495
p.rstrip("/")
496-
if not append_slash_to_dirname and info["type"] == "directory" and p.endswith("/")
496+
if not append_slash_to_dirname
497+
and info["type"] == "directory"
498+
and p.endswith("/")
497499
else p
498500
): info
499501
for p, info in sorted(allpaths.items())

fsspec/implementations/tests/test_http.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
import fsspec.asyn
1212
import fsspec.utils
1313
from fsspec.implementations.http import HTTPStreamFile
14-
from fsspec.tests.conftest import data, reset_files, server, stdlib_simple_http_server, win # noqa: F401
14+
from fsspec.tests.conftest import reset_files # noqa: F401
15+
from fsspec.tests.conftest import server # noqa: F401
16+
from fsspec.tests.conftest import stdlib_simple_http_server # noqa: F401
17+
from fsspec.tests.conftest import data, win
1518

1619

1720
def test_list(server):
@@ -131,7 +134,7 @@ def test_list_cache_with_skip_instance_cache(server):
131134

132135
def test_glob_return_subfolders(stdlib_simple_http_server):
133136
h = fsspec.filesystem("http")
134-
out = h.glob(stdlib_simple_http_server + "/*", )
137+
out = h.glob(stdlib_simple_http_server + "/*")
135138
assert out == [
136139
stdlib_simple_http_server + "/file1",
137140
stdlib_simple_http_server + "/file2",

0 commit comments

Comments
 (0)