Skip to content

Commit c199564

Browse files
Print more stuff.
1 parent 4347b13 commit c199564

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/test/test_code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,9 @@ def func_with_globals_and_builtins():
966966
return callable(mod2), tuple(mods), list(mods), checks
967967

968968
func = func_with_globals_and_builtins
969+
dis.dis(func)
970+
for i, instr in enumerate(dis.get_instructions(func)):
971+
print(i, instr, end='')
969972
with self.subTest(f'{func} code'):
970973
expected = new_var_counts(
971974
purelocals=4,

Objects/codeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,8 @@ identify_unbound_names(PyThreadState *tstate, PyCodeObject *co,
17301730
assert(counts == NULL || counts->total == 0);
17311731
struct co_unbound_counts unbound = {0};
17321732
Py_ssize_t len = Py_SIZE(co);
1733+
fprintf(stderr, "\n");
1734+
fprintf(stderr, "%s\n", PyUnicode_AsUTF8(co->co_name));
17331735
for (int i = 0; i < len; i++) {
17341736
fprintf(stderr, "%d\n", i);
17351737
fflush(stderr);

0 commit comments

Comments
 (0)