Skip to content

Commit a42c073

Browse files
committed
Fix.
1 parent 4be630a commit a42c073

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

mocket/decorators/async_mocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def wrapper(
1616
return await test(*args, **kwargs)
1717

1818

19-
async_mocketize = get_mocketize(wrapper_=wrapper)
19+
async_mocketize = get_mocketize(wrapper)
2020

2121

2222
__all__ = ("async_mocketize",)

mocket/decorators/mocketizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ def wrapper(
9292
return test(*args, **kwargs)
9393

9494

95-
mocketize = get_mocketize(wrapper_=wrapper)
95+
mocketize = get_mocketize(wrapper)

mocket/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from __future__ import annotations
22

33
import binascii
4+
import contextlib
45
from typing import Callable
56

7+
import decorator
8+
69
from mocket.compat import decode_from_bytes, encode_to_bytes
710

811

@@ -28,10 +31,9 @@ def hexload(string: str) -> bytes:
2831

2932

3033
def get_mocketize(wrapper_: Callable) -> Callable:
31-
import decorator
32-
33-
kwargs = {} if decorator.__version__ < "5" else {"kwsyntax": True}
34-
return decorator.decorator(wrapper_, **kwargs)
34+
with contextlib.suppress(TypeError):
35+
return decorator.decorator(wrapper_, kwsyntax=True) # type: ignore[call-arg]
36+
return decorator.decorator(wrapper_)
3537

3638

3739
__all__ = (

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
]
2929
dependencies = [
3030
"puremagic",
31-
"decorator>=4.0.0",
31+
"decorator>=5.0.0",
3232
"urllib3>=1.25.3",
3333
"h11",
3434
"typing-extensions",

0 commit comments

Comments
 (0)