From 49017f0c29edfa551bd39e82231187568534ddea 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 ++++- poetry.lock | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 3 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/poetry.lock b/poetry.lock index 22dfaf8c..25e45ca1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1936,4 +1936,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e5010ae4f28e264fe5f6a6dbda855196e128cac770f603d59925e6c93d1ff07a" +content-hash = "d841debe32baa3e738b6930755f659a114cbc3a988e87dfdfae1a578349aa161" diff --git a/pyproject.toml b/pyproject.toml index dc25853c..3205ad3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ packages = [{ include = "aio_pika" }] python = "^3.9" aiormq = "~6.8" yarl = [{ version = '*'}] -exceptiongroup = "^1" +exceptiongroup = [{ version = "^1", python = "< 3.11" }] typing-extensions = [{ version = '*', python = "< 3.10" }] [tool.poetry.group.dev.dependencies]