From c3b8bb6a1a75707c9dd61f656a81e9cd89de7355 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Mon, 11 Nov 2024 16:51:18 +0000 Subject: [PATCH] Fix printing namespaces with hoisted literals These bindings do not have a name to sort by, so use their value instead. --- test/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers.py b/test/helpers.py index b145213..1b9f22f 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -43,7 +43,7 @@ def namespace_name(node): for name in sorted(namespace.nonlocal_names): s += indent + ' - nonlocal ' + name + '\n' - for binding in sorted(namespace.bindings, key=lambda b: b.name): + for binding in sorted(namespace.bindings, key=lambda b: b.name or str(b.value)): s += indent + ' - ' + repr(binding) + '\n' for child in iter_child_namespaces(namespace):