From 04d9249ab18cd7bd8b54958714d24614f27863b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Weso=C5=82owski?= <129270367+wesolowski-gh@users.noreply.github.com> Date: Wed, 29 Mar 2023 13:13:54 +0200 Subject: [PATCH] Command signature inspection fix (#6029) (#6032) --- mitmproxy/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitmproxy/command.py b/mitmproxy/command.py index d9b56b584..5b12497e1 100644 --- a/mitmproxy/command.py +++ b/mitmproxy/command.py @@ -22,7 +22,7 @@ from mitmproxy.command_lexer import unquote def verify_arg_signature(f: Callable, args: Iterable[Any], kwargs: dict) -> None: - sig = inspect.signature(f) + sig = inspect.signature(f, eval_str=True) try: sig.bind(*args, **kwargs) except TypeError as v: @@ -71,7 +71,7 @@ class Command: self.name = name self.manager = manager self.func = func - self.signature = inspect.signature(self.func) + self.signature = inspect.signature(self.func, eval_str=True) if func.__doc__: txt = func.__doc__.strip()