mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
Changelog since 3.3.1: - v3.3.2: Fix crash on Python 3.10 during interpreter shutdown with active greenlets Add test.sh. Full changelog: https://github.com/python-greenlet/greenlet/releases Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
26 lines
493 B
Bash
26 lines
493 B
Bash
#!/bin/sh
|
|
|
|
[ "$1" = python3-greenlet ] || exit 0
|
|
|
|
python3 - <<'EOF'
|
|
import greenlet
|
|
|
|
results = []
|
|
|
|
def consumer():
|
|
while True:
|
|
value = greenlet.getcurrent().parent.switch()
|
|
if value is None:
|
|
break
|
|
results.append(value * 2)
|
|
|
|
c = greenlet.greenlet(consumer)
|
|
c.switch() # start consumer, runs until first switch back
|
|
|
|
for i in [1, 2, 3]:
|
|
c.switch(i)
|
|
c.switch(None) # signal done
|
|
|
|
assert results == [2, 4, 6], f"Expected [2, 4, 6], got {results}"
|
|
EOF
|