python 10 compat

This commit is contained in:
sneakers-the-rat 2024-07-02 00:19:21 -07:00
parent 566d5211bb
commit 444ecbaf04
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D

View file

@ -4,10 +4,18 @@ Maps to change the loaded .yaml from nwb schema before it's given to the nwb_sch
import ast import ast
import re import re
import sys
from dataclasses import dataclass from dataclasses import dataclass
from enum import StrEnum
from typing import ClassVar, List, Optional from typing import ClassVar, List, Optional
if sys.version_info.minor < 11:
from enum import StrEnum
else:
from enum import Enum
class StrEnum(str, Enum):
"""StrEnum-ish class for python 3.10"""
class SCOPE_TYPES(StrEnum): class SCOPE_TYPES(StrEnum):
"""When a mapping should be applied """When a mapping should be applied