Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696779
utils.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
541 B
Subscribers
None
utils.py
View Options
# Copyright (C) 2021 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
asyncio
def
call_async
(
f
,
*
args
):
"""Calls an async coroutine from a synchronous function."""
loop
=
asyncio
.
new_event_loop
()
try
:
return
loop
.
run_until_complete
(
f
(
*
args
))
finally
:
loop
.
run_until_complete
(
loop
.
shutdown_asyncgens
())
loop
.
close
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Mon, Aug 18, 9:29 PM (1 h, 25 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3240423
Attached To
rDOBJS Object storage
Event Timeline
Log In to Comment