@@ -329,13 +329,15 @@ _objsnapshot_clear(_objsnapshot *osn)
329329// PyMem_Free(osn);
330330//}
331331
332+ #ifndef NDEBUG
332333static int
333334_objsnapshot_is_clear (_objsnapshot * osn )
334335{
335336 return osn -> serialized == NULL
336337 && _rawstring_is_clear (& osn -> modname )
337338 && _rawstring_is_clear (& osn -> clsname );
338339}
340+ #endif
339341
340342static void
341343_objsnapshot_summarize (_objsnapshot * osn , _rawstring * rawbuf , const char * msg )
@@ -597,13 +599,15 @@ _tbsnapshot_free(_tbsnapshot *tbs)
597599 PyMem_Free (tbs );
598600}
599601
602+ #ifndef NDEBUG
600603static int
601604_tbsnapshot_is_clear (_tbsnapshot * tbs )
602605{
603606 return tbs -> tbs_lineno == -1 && tbs -> tbs_next == NULL
604607 && _rawstring_is_clear (& tbs -> tbs_funcname )
605608 && _rawstring_is_clear (& tbs -> tbs_filename );
606609}
610+ #endif
607611
608612static int
609613_tbsnapshot_from_pytb (_tbsnapshot * tbs , PyTracebackObject * pytb )
@@ -748,6 +752,7 @@ _excsnapshot_free(_excsnapshot *es)
748752 PyMem_Free (es );
749753}
750754
755+ #ifndef NDEBUG
751756static int
752757_excsnapshot_is_clear (_excsnapshot * es )
753758{
@@ -758,6 +763,7 @@ _excsnapshot_is_clear(_excsnapshot *es)
758763 && es -> es_msg == NULL
759764 && _objsnapshot_is_clear (& es -> es_object );
760765}
766+ #endif
761767
762768static PyObject *
763769_excsnapshot_get_exc_naive (_excsnapshot * es )
@@ -1085,13 +1091,15 @@ _sharedexception_free(_sharedexception *she)
10851091 PyMem_Free (she );
10861092}
10871093
1094+ #ifndef NDEBUG
10881095static int
10891096_sharedexception_is_clear (_sharedexception * she )
10901097{
10911098 return 1
10921099 && _excsnapshot_is_clear (& she -> snapshot )
10931100 && _rawstring_is_clear (& she -> msg );
10941101}
1102+ #endif
10951103
10961104static PyObject *
10971105_sharedexception_get_cause (_sharedexception * sharedexc )
0 commit comments