Explorar el Código

avoid warnings in tests

Falko Schindler hace 2 años
padre
commit
af01528584
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      nicegui/elements/element.py

+ 4 - 1
nicegui/elements/element.py

@@ -112,5 +112,8 @@ class Element:
         return self
 
     def update(self) -> None:
-        if asyncio.get_event_loop().is_running():
+        try:
+            asyncio.get_running_loop()
+        except RuntimeError:
+            return
             create_task(self.view.update())