浏览代码

re-enable exception handling of CancelledError

Falko Schindler 3 年之前
父节点
当前提交
3e1a07340b
共有 1 个文件被更改,包括 2 次插入2 次删除
  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)