From 28353ac59f385c95fe944dd1255e2f92052113cd Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Wed, 27 Nov 2024 13:32:07 -0600 Subject: [PATCH] Only require exceptiongroup dependency for Python <3.11 --- aio_pika/queue.py | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aio_pika/queue.py b/aio_pika/queue.py index 9b4cd3de..75e28ad3 100644 --- a/aio_pika/queue.py +++ b/aio_pika/queue.py @@ -8,7 +8,10 @@ import aiormq from aiormq.abc import DeliveredMessage -from exceptiongroup import ExceptionGroup +try: + ExceptionGroup +except NameError: + from exceptiongroup import ExceptionGroup from pamqp.common import Arguments from .abc import ( diff --git a/pyproject.toml b/pyproject.toml index 1bc76c43..9e18de10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ packages = [{ include = "aio_pika" }] python = "^3.9" aiormq = "~6.8.0" yarl = [{ version = '*'}] -exceptiongroup = "^1" +exceptiongroup = [{ version = "^1", python = "< 3.11" }] typing_extensions = [{ version = '*', python = "< 3.10" }] [tool.poetry.group.dev.dependencies]