Skip to content

Commit c885b1e

Browse files
committed
Update ExchangeType def in pika so that __format__ resolves correctly
1 parent 9bcd091 commit c885b1e

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

stubs/pika/pika/exchange_type.pyi

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
from enum import Enum
1+
import sys
22

3-
class ExchangeType(Enum):
4-
direct = "direct"
5-
fanout = "fanout"
6-
headers = "headers"
7-
topic = "topic"
3+
if sys.version_info >= (3, 11):
4+
from enum import StrEnum
5+
6+
class ExchangeType(StrEnum):
7+
direct = "direct"
8+
fanout = "fanout"
9+
headers = "headers"
10+
topic = "topic"
11+
12+
else:
13+
from enum import Enum
14+
15+
class ExchangeType(str, Enum):
16+
direct = "direct"
17+
fanout = "fanout"
18+
headers = "headers"
19+
topic = "topic"

0 commit comments

Comments
 (0)