examples/webrtc/signalling: Fix compatibility with Python 3.10
authorSam Van Den Berge <sam.van.den.berge@gmail.com>
Mon, 17 Oct 2022 08:39:18 +0000 (10:39 +0200)
committerSam Van Den Berge <sam.van.den.berge@gmail.com>
Mon, 17 Oct 2022 09:46:51 +0000 (11:46 +0200)
Fix asyncio throwing a deprecation warning when using
asyncio.get_event_loop().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3196>

subprojects/gst-examples/webrtc/signalling/room-client.py
subprojects/gst-examples/webrtc/signalling/session-client.py

index e82a3f242c4ee1a99fd1863d27267e60cd7c3b5f..b779a19677c92d341af3c5a538f313c953650cb7 100755 (executable)
@@ -98,7 +98,7 @@ async def hello():
 print('Our uid is {!r}'.format(PEER_ID))
 
 try:
-    asyncio.get_event_loop().run_until_complete(hello())
+    asyncio.run(hello())
 except websockets.exceptions.InvalidHandshake:
     print('Invalid handshake: are you sure this is a websockets server?\n')
     raise
index d7d0f3ed64516d1ad9a834ea4b1f44bb09bfeac6..9df1d5fbc08eb2b8997f7f27c1f8cc03441f3c79 100755 (executable)
@@ -78,7 +78,7 @@ async def hello():
 print('Our uid is {!r}'.format(PEER_ID))
 
 try:
-    asyncio.get_event_loop().run_until_complete(hello())
+    asyncio.run(hello())
 except websockets.exceptions.InvalidHandshake:
     print('Invalid handshake: are you sure this is a websockets server?\n')
     raise