This commit is contained in:
Ari Archer 2021-11-29 16:51:04 +02:00
parent 5ed3e9b1bf
commit 958c3e9a70
Signed by untrusted user who does not match committer: ari
GPG key ID: A50D5B4B599AF8A2
2 changed files with 3 additions and 3 deletions

View file

@ -964,7 +964,7 @@ class Controller:
setattr(
self,
function_name,
copy_func(handle), # type: ignore
copy_func(handle),
)

View file

@ -44,7 +44,7 @@ def copy_func(f: Callable) -> Callable[[], Any]:
g = types.FunctionType(
f.__code__,
f.__globals__, # type: ignore
name=f.__name__, # type: ignore
name=f.__name__,
argdefs=f.__defaults__, # type: ignore
closure=f.__closure__, # type: ignore
)
@ -54,7 +54,7 @@ def copy_func(f: Callable) -> Callable[[], Any]:
def rename_function(new_name: str) -> Callable:
def decorator(fun: Callable):
def decorator(fun: Callable) -> Callable:
fun.__name__ = new_name
return fun