Merge pull request #1149 from AlexandreAANP/fix/windows-asyncio-loop

Fix event loop handling for Windows platform in compose_up function
This commit is contained in:
Povilas Kanapickas 2025-03-01 16:43:26 +02:00 committed by GitHub
commit a54f0fa573
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1 @@
- Fixed NotImplementedError in case script is interrupted on Windows

View File

@ -2777,9 +2777,9 @@ async def compose_up(compose: PodmanCompose, args):
max_service_length = curr_length if curr_length > max_service_length else max_service_length
tasks = set()
loop = asyncio.get_event_loop()
loop.add_signal_handler(signal.SIGINT, lambda: [t.cancel("User exit") for t in tasks])
if sys.platform != 'win32':
loop = asyncio.get_event_loop()
loop.add_signal_handler(signal.SIGINT, lambda: [t.cancel("User exit") for t in tasks])
for i, cnt in enumerate(compose.containers):
# Add colored service prefix to output by piping output through sed