Skip to content

Commit c5fbd72

Browse files
authored
fix: 🩹 asfunction minor bug
1 parent 853f5a0 commit c5fbd72

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

injection/_core/asfunction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from collections.abc import Callable
33
from functools import wraps
44
from inspect import iscoroutinefunction
5-
from types import MethodType
65
from typing import Any, Protocol, runtime_checkable
76

87
from injection._core.common.asynchronous import Caller
@@ -30,7 +29,7 @@ def asfunction[**P, T](
3029
module = module or mod()
3130

3231
def decorator(wp: AsFunctionWrappedType[P, T]) -> Callable[P, T]:
33-
fake_method = MethodType(wp.call, NotImplemented)
32+
fake_method = wp.call.__get__(NotImplemented)
3433
factory: Caller[..., AsFunctionCallable[P, T]] = module.make_injected_function(
3534
wp,
3635
threadsafe=threadsafe,

0 commit comments

Comments
 (0)