From b112b18848379cea80ae81bb60837384eb1a187c Mon Sep 17 00:00:00 2001
From: Franck Nijhof <git@frenck.dev>
Date: Tue, 22 Jun 2021 21:16:50 +0200
Subject: [PATCH] Get running event loop in debugpy (#52091)

---
 homeassistant/components/debugpy/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/homeassistant/components/debugpy/__init__.py b/homeassistant/components/debugpy/__init__.py
index 72f2e8db067..613ecfd8ffa 100644
--- a/homeassistant/components/debugpy/__init__.py
+++ b/homeassistant/components/debugpy/__init__.py
@@ -1,7 +1,7 @@
 """The Remote Python Debugger integration."""
 from __future__ import annotations
 
-from asyncio import Event, get_event_loop
+from asyncio import Event, get_running_loop
 import logging
 from threading import Thread
 
@@ -44,7 +44,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
         call: ServiceCall | None = None, *, wait: bool = True
     ) -> None:
         """Enable asyncio debugging and start the debugger."""
-        get_event_loop().set_debug(True)
+        get_running_loop().set_debug(True)
 
         debugpy.listen((conf[CONF_HOST], conf[CONF_PORT]))