Skip to content

Commit 435519d

Browse files
committed
Use manual polyfill for StrEnum
StrEnum only available in 3.11 :(
1 parent d43311b commit 435519d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/pipx/constants.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
from typing import NewType
77

88

9-
class FetchPythonOptions(enum.StrEnum):
10-
ALWAYS = enum.auto()
11-
MISSING = enum.auto()
12-
NEVER = enum.auto()
9+
# XXX: Python 3.11 StrEnum + enum.auto()
10+
class FetchPythonOptions(str, enum.Enum):
11+
ALWAYS = "always"
12+
MISSING = "missing"
13+
NEVER = "never"
14+
15+
def __str__(self):
16+
return self.value
1317

1418

1519
PIPX_SHARED_PTH = "pipx_shared.pth"

0 commit comments

Comments
 (0)