Skip to content

Commit 48e0935

Browse files
committed
Correctly handle self in posargs2kwargs
1 parent a0a0b38 commit 48e0935

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

domdf_python_tools/utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@ def posargs2kwargs(
263263
self_arg = None
264264

265265
if isinstance(posarg_names, MethodType):
266-
posarg_names = inspect.getfullargspec(posarg_names).args
267-
self_arg = posarg_names[0]
266+
self_arg, *posarg_names = inspect.getfullargspec(posarg_names).args
268267
elif callable(posarg_names):
269268
posarg_names = inspect.getfullargspec(posarg_names).args
270269

tests/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def demo_function(arg1, arg2, arg3):
286286
"buffering": -1,
287287
"encoding": "UTF-8",
288288
}),
289-
((cwd, "wb", -1, "UTF-8"),
289+
(("wb", -1, "UTF-8"),
290290
pathlib.Path().open,
291291
None, {
292292
"mode": "wb",

0 commit comments

Comments
 (0)