Skip to content

Commit

Permalink
Merge pull request #190 from innolitics/fix-strenum-import
Browse files Browse the repository at this point in the history
Fix: fix broken import for python versions < 3.11
  • Loading branch information
notmatthancock authored Jul 18, 2024
2 parents a7ef203 + b09d52a commit be4bb51
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 be4bb51

Please sign in to comment.