Skip to content

Commit 7d601e9

Browse files
committed
Don't gather stats unless configure flag is set.
1 parent a60b843 commit 7d601e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ specialize_class_load_method(PyObject *owner, _Py_CODEUNIT *instr, PyObject *nam
979979
cache2->obj = descr;
980980
*instr = _Py_MAKECODEUNIT(LOAD_METHOD_CLASS, _Py_OPARG(*instr));
981981
return 0;
982+
#ifdef Py_STATS
982983
case ABSENT:
983984
if (_PyType_Lookup(Py_TYPE(owner), name) != NULL) {
984985
SPECIALIZATION_FAIL(LOAD_METHOD, SPEC_FAIL_METACLASS_ATTRIBUTE);
@@ -987,6 +988,7 @@ specialize_class_load_method(PyObject *owner, _Py_CODEUNIT *instr, PyObject *nam
987988
SPECIALIZATION_FAIL(LOAD_METHOD, SPEC_FAIL_EXPECTED_ERROR);
988989
}
989990
return -1;
991+
#endif
990992
default:
991993
SPECIALIZATION_FAIL(LOAD_METHOD, load_method_fail_kind(kind));
992994
return -1;

0 commit comments

Comments
 (0)