Skip to content

Commit

Permalink
Merge branch 'master' of github.com:cheginit/pygeoogc
Browse files Browse the repository at this point in the history
  • Loading branch information
cheginit committed Dec 7, 2020
2 parents 219ddd8 + f1ee94d commit cb10389
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pygeoogc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ def async_requests(
list
A list of responses
"""
import sys

if not isinstance(urls, list) and not isinstance(urls, dict):
raise InvalidInputType("urls", "list of urls or dict of urls and payloads")

Expand All @@ -272,6 +274,8 @@ def async_requests(

results: List[Union[str, MutableMapping[str, Any], bytes]] = []
for chunk in chunked_urls:
if sys.platform.startswith("win"):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
loop = asyncio.get_event_loop()
results.append(loop.run_until_complete(_async_session(chunk, read, request))) # type: ignore
del loop
Expand Down

0 comments on commit cb10389

Please sign in to comment.