Skip to content

Commit

Permalink
Use try/except for python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Nov 30, 2023
1 parent 4f8a144 commit 8d58d02
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions webviz_ert/models/data_model.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import sys
try:
from enum import StrEnum

if sys.version_info < (3, 11):
except ImportError:
from enum import Enum

class StrEnum(str, Enum):
pass

else:
from enum import StrEnum
def __str__(self):
return self.value


class DataType(StrEnum):
Expand Down

0 comments on commit 8d58d02

Please sign in to comment.