Skip to content

Commit aa7c453

Browse files
committed
Fix Python 3.10 warnings
1 parent a6dd3f5 commit aa7c453

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/gql-cli

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ parser = get_parser(with_examples=True)
1010
args = parser.parse_args()
1111

1212
try:
13-
loop = asyncio.get_event_loop()
13+
# Create a new asyncio event loop
14+
loop = asyncio.new_event_loop()
15+
asyncio.set_event_loop(loop)
1416

1517
# Create a gql-cli task with the supplied arguments
16-
main_task = asyncio.ensure_future(main(args))
18+
main_task = asyncio.ensure_future(main(args), loop=loop)
1719

1820
# Add signal handlers to close gql-cli cleanly on Control-C
1921
for signal in [SIGINT, SIGTERM]:

0 commit comments

Comments
 (0)