From bd845c58f090433d62beaa5732fc7ac436c63725 Mon Sep 17 00:00:00 2001 From: Marek Skrobacki Date: Thu, 17 Apr 2025 16:26:08 +0100 Subject: [PATCH] fix(neutron): resolve crash because of missing typings --- .../neutron_understack/ml2_type_annotations.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/neutron-understack/neutron_understack/ml2_type_annotations.py b/python/neutron-understack/neutron_understack/ml2_type_annotations.py index eb209b720..79fb65493 100644 --- a/python/neutron-understack/neutron_understack/ml2_type_annotations.py +++ b/python/neutron-understack/neutron_understack/ml2_type_annotations.py @@ -1,8 +1,16 @@ from typing import Any from typing import Literal -from typing import NotRequired + +try: + from typing import NotRequired + from typing import TypedDict + # neutron container currently runs with Python 3.10 which does not have + # support for NotRequired, so we have to fallback to the backported version +except ImportError: + from typing_extensions import NotRequired + from typing_extensions import TypedDict + from typing import TypeAlias -from typing import TypedDict NetworkTypeName: TypeAlias = Literal["vxlan", "vlan"] PortStatusName: TypeAlias = Literal["DOWN", "ACTIVE"]