From 4032d5320779be1ed29f99188f3e15eb0c7e62c2 Mon Sep 17 00:00:00 2001 From: Guillaume Gauvrit Date: Sun, 3 Nov 2024 08:49:57 +0100 Subject: [PATCH] Restore python3.9 compat --- src/blacksmith/service/_async/route_proxy.py | 6 ++++++ src/blacksmith/service/_sync/route_proxy.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/blacksmith/service/_async/route_proxy.py b/src/blacksmith/service/_async/route_proxy.py index cdf7db1..2665e00 100644 --- a/src/blacksmith/service/_async/route_proxy.py +++ b/src/blacksmith/service/_async/route_proxy.py @@ -11,6 +11,12 @@ get_origin, ) +try: + from types import UnionType # type: ignore +except ImportError: # coverage: ignore + # python 3.9 compat + UnionType = Union # type: ignore + from pydantic import ValidationError from result import Err, Ok, Result diff --git a/src/blacksmith/service/_sync/route_proxy.py b/src/blacksmith/service/_sync/route_proxy.py index d758523..18c301f 100644 --- a/src/blacksmith/service/_sync/route_proxy.py +++ b/src/blacksmith/service/_sync/route_proxy.py @@ -14,7 +14,7 @@ try: from types import UnionType # type: ignore except ImportError: # coverage: ignore - # python 3.7 compat + # python 3.9 compat UnionType = Union # type: ignore from pydantic import ValidationError