added python >= 3.10 compatibility

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-03-31 16:07:15 +02:00
parent 8323035af3
commit 1d42f2585e
No known key found for this signature in database

View File

@ -7,6 +7,7 @@
import json
import logging
import asyncio
import sys
from planetmint.ipc.events import EventTypes
@ -65,7 +66,10 @@ class Dispatcher:
run_loop = asyncio.get_running_loop()
logging.debug(f"get loop: {get_loop}")
logging.debug(f"run loop: {run_loop}")
app[queue_name] = asyncio.Queue(loop=get_loop)
if( sys.version_info.major ==3 and sys.version_info.minor < 10 ):
app[queue_name] = asyncio.Queue(loop=get_loop)
elif( sys.version_info.major ==3 and sys.version_info.minor >= 10 ):
app[queue_name] = asyncio.Queue()
return app[queue_name]