Skip to content

Commit c4a8983

Browse files
committed
robust flatten
1 parent 304c934 commit c4a8983

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

mpcontribs-client/mpcontribs/client/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,9 +1180,14 @@ def search_future(search_term):
11801180
]
11811181
responses = _run_futures(futures, total=total_count, timeout=timeout)
11821182

1183-
ret["data"].extend([resp["result"]["data"] for resp in responses.values()])
1184-
1185-
return ret["data"]
1183+
return list(
1184+
itertools.chain.from_iterable(
1185+
[
1186+
ret["data"],
1187+
[resp["result"]["data"] for resp in responses.values()][0],
1188+
]
1189+
)
1190+
)
11861191

11871192
def create_project(
11881193
self, name: str, title: str, authors: str, description: str, url: str

0 commit comments

Comments
 (0)