From 5facc5dd3b93bfe4958e2e2d842ada700a930179 Mon Sep 17 00:00:00 2001 From: Ilya Priven Date: Fri, 29 Sep 2023 23:12:02 -0400 Subject: [PATCH] typing_extensions should be optional on Python 3.11 (#1198) typing_extensions should be optional --- pynamodb/exceptions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pynamodb/exceptions.py b/pynamodb/exceptions.py index 4e4c00951..39dd5437b 100644 --- a/pynamodb/exceptions.py +++ b/pynamodb/exceptions.py @@ -1,13 +1,17 @@ """ PynamoDB exceptions """ +import sys from dataclasses import dataclass from typing import Any from typing import Dict from typing import Iterable from typing import List from typing import Optional -from typing_extensions import Literal +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal import botocore.exceptions