Skip to content

Commit 88a5730

Browse files
committed
comments: fix mro issue
1 parent 6dfbc8f commit 88a5730

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

marimo/_save/stubs/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ def maybe_register_stub(value: Any) -> bool:
4242
return True
4343

4444
# Walk MRO to find matching base class
45-
for cls in value_type.__mro__:
45+
try:
46+
mro_list = value_type.mro()
47+
except BaseException:
48+
# Some exotic metaclasses or broken types may raise when calling mro
49+
mro_list = [value_type]
50+
51+
for cls in mro_list:
4652
if not (hasattr(cls, "__module__") and hasattr(cls, "__name__")):
4753
continue
4854

0 commit comments

Comments
 (0)