refactor: replace get_event_loop with asyncio.run for better async handling in example scripts

This commit is contained in:
deesiigneer
2026-01-30 22:36:18 +00:00
parent 931b1a8621
commit 6906afb090
5 changed files with 37 additions and 33 deletions

View File

@@ -1,7 +1,8 @@
import asyncio
from pyspapi import SPAPI
from asyncio import get_event_loop
spapi = SPAPI(card_id='CARD_ID', token='TOKEN')
spapi = SPAPI(card_id="CARD_ID", token="TOKEN")
async def main():
@@ -11,5 +12,4 @@ async def main():
print(card.name, card.number)
loop = get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())