Browse Source

avoid warnings in tests

Falko Schindler 2 years ago
parent
commit
af01528584
1 changed files with 4 additions and 1 deletions
  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())