Browse Source

re-enable exception handling of CancelledError

Falko Schindler 3 năm trước cách đây
mục cha
commit
3e1a07340b
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      nicegui/timer.py

+ 2 - 2
nicegui/timer.py

@@ -45,8 +45,8 @@ class Timer:
                             await parent.update()
                     dt = time.time() - start
                     await asyncio.sleep(interval - dt)
-                # except CancelledError: # only works for python >= 3.8
-                #     pass
+                except asyncio.CancelledError:
+                    pass
                 except:
                     traceback.print_exc()
                     await asyncio.sleep(interval)