Skip to content

Commit

Permalink
fix: fix broken import for python versions < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
notmatthancock committed Jul 11, 2024
1 parent a7ef203 commit b09d52a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ build/
dist/
.vscode
venv
.venv
.tool-versions
_debug_pkg
_debug_pkg
11 changes: 10 additions & 1 deletion n2y/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from enum import StrEnum
try:
from enum import StrEnum
except ImportError:
# StrEnum introduced in 3.11
# StrEnum defined per recommendation here:
# https://docs.python.org/3.10/library/enum.html#others
from enum import Enum

class StrEnum(str, Enum):
pass


class N2YError(Exception):
Expand Down

0 comments on commit b09d52a

Please sign in to comment.