webrtc_sendrecv.py: Fix deprecation warning with Python 3.10
asyncio.get_event_loop() will not implicitly create a new event loop in a future version of Python, so we need to do that explicitly. ``` webrtc_sendrecv.py:188: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() ``` Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1821>
This commit is contained in:
parent
4c2fd7f104
commit
e453e43e5a
@ -185,7 +185,7 @@ if __name__ == '__main__':
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
our_id = random.randrange(10, 10000)
|
our_id = random.randrange(10, 10000)
|
||||||
c = WebRTCClient(our_id, args.peerid, args.server)
|
c = WebRTCClient(our_id, args.peerid, args.server)
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
loop.run_until_complete(c.connect())
|
loop.run_until_complete(c.connect())
|
||||||
res = loop.run_until_complete(c.loop())
|
res = loop.run_until_complete(c.loop())
|
||||||
sys.exit(res)
|
sys.exit(res)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user