Skip to content

Commit 66791fd

Browse files
🪲 BUG-#133: Include keyword-only parameters in _set_params via co_kwonlyargcount
1 parent e09fec5 commit 66791fd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎dotflow/core/action.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,19 @@ def _call_func(self, is_async, *args, **kwargs):
200200
def _set_params(self):
201201
if isinstance(self.func, FunctionType):
202202
code = self.func.__code__
203-
self.params = list(code.co_varnames[: code.co_argcount])
203+
self.params = list(
204+
code.co_varnames[: code.co_argcount + code.co_kwonlyargcount]
205+
)
204206

205207
if (
206208
type(self.func) is type
207209
and hasattr(self.func, "__init__")
208210
and hasattr(self.func.__init__, "__code__")
209211
):
210212
code = self.func.__init__.__code__
211-
self.params = list(code.co_varnames[: code.co_argcount])
213+
self.params = list(
214+
code.co_varnames[: code.co_argcount + code.co_kwonlyargcount]
215+
)
212216

213217
def _get_context(self, kwargs: dict):
214218
context = {}

0 commit comments

Comments
 (0)