mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
Changes since 1.3.0: - Fix compatibility with Python 3.12+ by updating deprecated asyncio internals usage Also add test.sh to verify version and asyncio library detection. Link: https://github.com/python-trio/sniffio/blob/master/CHANGELOG.rst Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
25 lines
430 B
Bash
Executable File
25 lines
430 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = "python3-sniffio" ] || exit 0
|
|
|
|
python3 - << EOF
|
|
import sys
|
|
import sniffio
|
|
|
|
if sniffio.__version__ != "$2":
|
|
print("Wrong version: " + sniffio.__version__)
|
|
sys.exit(1)
|
|
|
|
from sniffio import current_async_library
|
|
from sniffio import AsyncLibraryNotFoundError
|
|
|
|
# Outside async context should raise
|
|
try:
|
|
current_async_library()
|
|
sys.exit(1)
|
|
except AsyncLibraryNotFoundError:
|
|
pass
|
|
|
|
sys.exit(0)
|
|
EOF
|