Przeglądaj źródła

making sure we support python 3.7

Rodja Trappe 3 lat temu
rodzic
commit
68fa244564
2 zmienionych plików z 3 dodań i 4 usunięć
  1. 1 1
      development.dockerfile
  2. 2 3
      nicegui/timer.py

+ 1 - 1
development.dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.9-slim
+FROM python:3.7-slim
 
 RUN apt update && apt install curl -y
 

+ 2 - 3
nicegui/timer.py

@@ -2,7 +2,6 @@ import asyncio
 import time
 import traceback
 from typing import Awaitable
-from asyncio.exceptions import CancelledError
 from binding import BindableProperty
 from .elements.element import Element
 from .utils import handle_exceptions
@@ -46,8 +45,8 @@ class Timer:
                             await parent.update()
                     dt = time.time() - start
                     await asyncio.sleep(interval - dt)
-                except CancelledError:
-                    pass
+                # except CancelledError: # only works for python >= 3.8
+                #     pass
                 except:
                     traceback.print_exc()
                     await asyncio.sleep(interval)