Skip to content

Commit 64a7812

Browse files
authored
Update test__opcode and _Py_GetSpecializationStats with recent specialization stat changes (GH-27728)
1 parent 08caf2d commit 64a7812

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/test/test__opcode.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ def test_specialization_stats(self):
8282
self.assertCountEqual(stats.keys(), specialized_opcodes)
8383
self.assertCountEqual(
8484
stats['load_attr'].keys(),
85-
stat_names + ['fails'])
85+
stat_names + ['specialization_failure_kinds'])
8686
for sn in stat_names:
8787
self.assertIsInstance(stats['load_attr'][sn], int)
88-
self.assertIsInstance(stats['load_attr']['specialization_failure_kinds'], tuple)
88+
self.assertIsInstance(
89+
stats['load_attr']['specialization_failure_kinds'],
90+
tuple)
8991
for v in stats['load_attr']['specialization_failure_kinds']:
9092
self.assertIsInstance(v, int)
9193

Python/specialize.c

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ _Py_GetSpecializationStats(void) {
122122
err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
123123
err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
124124
err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
125+
err += add_stat_dict(stats, STORE_ATTR, "store_attr");
125126
if (err < 0) {
126127
Py_DECREF(stats);
127128
return NULL;

0 commit comments

Comments
 (0)