Skip to content

Commit 40b7d48

Browse files
authored
Merge pull request #102 from bckohan/v2.x.x
fix groups app tree diagram
2 parents 1d8ca33 + 10a039b commit 40b7d48

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed
1.78 KB
Loading

tests/apps/util/management/commands/graph.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,32 @@
1515
else:
1616
from typing import Annotated
1717

18-
from enum import StrEnum
1918
from pathlib import Path
2019

2120
import graphviz
2221
import typer
2322

2423

25-
class Format(StrEnum):
26-
png = "png"
27-
svg = "svg"
28-
pdf = "pdf"
29-
dot = "dot"
24+
try:
25+
from enum import StrEnum
26+
27+
class Format(StrEnum):
28+
png = "png"
29+
svg = "svg"
30+
pdf = "pdf"
31+
dot = "dot"
32+
33+
except ImportError:
34+
from enum import Enum
35+
36+
class Format(str, Enum):
37+
png = "png"
38+
svg = "svg"
39+
pdf = "pdf"
40+
dot = "dot"
41+
42+
def __str__(self):
43+
return self.value
3044

3145

3246
class Command(TyperCommand):

0 commit comments

Comments
 (0)