Skip to content

Commit

Permalink
Fix partial in enum for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Dec 14, 2024
1 parent edb06c5 commit 607c2c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions miio/miot_device.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from enum import Enum
import sys
from enum import Enum, member
from functools import partial
from typing import Any, Optional, Union

Expand All @@ -20,7 +21,12 @@ def _str2bool(x):

Int = int
Float = float
Bool = partial(_str2bool)

if sys.version_info >= (3, 11):
Bool = member(partial(_str2bool))
else:
Bool = partial(_str2bool)

Check warning on line 28 in miio/miot_device.py

View check run for this annotation

Codecov / codecov/patch

miio/miot_device.py#L28

Added line #L28 was not covered by tests

Str = str


Expand Down

0 comments on commit 607c2c3

Please sign in to comment.