Skip to content

Commit c3b6a1e

Browse files
feat: Update to support python 3.12
- add case statement to use the asyncio.Queue.shutdown method for 3.13+ - add special handling to allow for similar semantics as asyncio.Queue.shutdown for 3.12 Tested on multiple samples in the a2a repo and some examples in this repo
1 parent 85b521d commit c3b6a1e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ classifiers = [
2222
"Intended Audience :: Developers",
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3",
25+
<<<<<<< HEAD
2526
"Programming Language :: Python :: 3.10",
2627
"Programming Language :: Python :: 3.11",
2728
"Programming Language :: Python :: 3.12",
2829
"Programming Language :: Python :: 3.13",
30+
=======
31+
"Programming Language :: Python :: 3.12",
32+
>>>>>>> 8ec734c (feat: Update to support python 3.12)
2933
"Operating System :: OS Independent",
3034
"Topic :: Software Development :: Libraries :: Python Modules",
3135
"License :: OSI Approved :: Apache Software License",

src/a2a/server/events/event_consumer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
from a2a.utils.errors import ServerError
1616
from a2a.utils.telemetry import SpanKind, trace_class
1717

18+
# This is an alias to the execption for closed queue
19+
QueueClosed = asyncio.QueueEmpty
20+
21+
# When using python 3.13 or higher, the closed queue signal is QueueShutdown
22+
if sys.version_info >= (3, 13):
23+
QueueClosed = asyncio.QueueShutDown
1824

1925
# This is an alias to the exception for closed queue
2026
QueueClosed = asyncio.QueueEmpty

0 commit comments

Comments
 (0)