Skip to content

Commit 1b6b053

Browse files
committed
fix: Don't try merging overload annotations into non-function objects
Issue-451: #451
1 parent 97106e4 commit 1b6b053

File tree

1 file changed

+8
-1
lines changed
  • packages/griffelib/src/griffe/_internal

1 file changed

+8
-1
lines changed

packages/griffelib/src/griffe/_internal/merger.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ def _merge_stubs_overloads(obj: Module | Class, stubs: Module | Class) -> None:
6363
for function_name, overloads in list(stubs.overloads.items()):
6464
if overloads:
6565
with suppress(KeyError):
66-
_merge_overload_annotations(obj.get_member(function_name), overloads)
66+
if (func := obj.get_member(function_name)).is_function:
67+
_merge_overload_annotations(func, overloads)
68+
else:
69+
logger.debug(
70+
"Cannot merge overload annotations into (non-function) %s %r",
71+
func.kind.value.lower(),
72+
func.path,
73+
)
6774
del stubs.overloads[function_name]
6875

6976

0 commit comments

Comments
 (0)