Skip to content

Commit 31c6df3

Browse files
committed
Okay now it works without browser
1 parent 5ab41f9 commit 31c6df3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wasm/demo/snippets/mandelbrot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
try:
22
from browser import request_animation_frame
33
except:
4-
def request_animation_frame(cb): cb()
4+
request_animation_frame = None
55

66
w = 50.0
77
h = 50.0
@@ -41,4 +41,5 @@ def mandel():
4141
def gen_cb(_time=None):
4242
gen.__next__()
4343
request_animation_frame(gen_cb)
44-
gen_cb()
44+
if request_animation_frame: gen_cb()
45+
else: list(gen)

0 commit comments

Comments
 (0)