Skip to content

Commit e99b69f

Browse files
committed
Handle case where names does not exist in node for some reason
1 parent 7707361 commit e99b69f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/trio/_tests/test_exports.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,13 @@ def lookup_symbol(symbol: str) -> dict[str, str]:
390390

391391
assert "node" in cached_type_info
392392
node = cached_type_info["node"]
393-
static_names = no_hidden(k for k in node["names"] if not k.startswith("."))
393+
static_names = no_hidden(
394+
k for k in node.get("names", ()) if not k.startswith(".")
395+
)
394396
for symbol in node["mro"][1:]:
395397
node = lookup_symbol(symbol)["node"]
396398
static_names |= no_hidden(
397-
k for k in node["names"] if not k.startswith(".")
399+
k for k in node.get("names", ()) if not k.startswith(".")
398400
)
399401
static_names -= ignore_names
400402

0 commit comments

Comments
 (0)