@@ -41,7 +41,7 @@ namespace ListMethods
4141 if ( strcmp ( method->ml_name , name ) == 0 )
4242 return method->ml_meth ;
4343 }
44- return 0 ;
44+ return 0 ; // LCOV_EXCL_LINE (failed method lookup)
4545 }
4646
4747 static bool
@@ -84,17 +84,17 @@ ListSubtype_New( PyTypeObject* subtype, Py_ssize_t size )
8484 if ( size < 0 )
8585 return cppy::system_error ( " negative list size" );
8686 if ( static_cast <size_t >( size ) > PY_SSIZE_T_MAX / sizeof ( PyObject* ) )
87- return PyErr_NoMemory (); // LCOV_EXCL_LINE
87+ return PyErr_NoMemory (); // LCOV_EXCL_LINE (memory error)
8888 cppy::ptr ptr ( PyType_GenericNew ( subtype, 0 , 0 ) );
8989 if ( !ptr )
90- return 0 ;
90+ return 0 ; // LCOV_EXCL_LINE (failed instance creation)
9191 PyListObject* op = reinterpret_cast <PyListObject*>( ptr.get () );
9292 if ( size > 0 )
9393 {
9494 size_t nbytes = size * sizeof ( PyObject* );
9595 op->ob_item = reinterpret_cast <PyObject**>( PyMem_Malloc ( nbytes ) );
9696 if ( !op->ob_item )
97- return PyErr_NoMemory (); // LCOV_EXCL_LINE
97+ return PyErr_NoMemory (); // LCOV_EXCL_LINE (memory error)
9898 memset ( op->ob_item , 0 , nbytes );
9999 }
100100#if PY_VERSION_HEX >= 0x03090000
@@ -128,7 +128,7 @@ class AtomListHandler
128128 return 0 ;
129129 if ( PyList_Append ( m_list.get (), item.get () ) != 0 )
130130 {
131- return 0 ;
131+ return 0 ; // LCOV_EXCL_LINE (failed append, impossible)
132132 }
133133 return cppy::incref ( Py_None );
134134 }
@@ -144,7 +144,7 @@ class AtomListHandler
144144 return 0 ;
145145 if ( PyList_Insert ( m_list.get (), index, valptr.get () ) != 0 )
146146 {
147- return 0 ;
147+ return 0 ; // LCOV_EXCL_LINE (failed insert, impossible)
148148 }
149149 return cppy::incref ( Py_None );
150150
@@ -272,7 +272,7 @@ AtomList_new( PyTypeObject* type, PyObject* args, PyObject* kwargs )
272272 cppy::ptr ptr ( PyList_Type.tp_new ( type, args, kwargs ) );
273273 if ( !ptr )
274274 {
275- return 0 ;
275+ return 0 ; // LCOV_EXCL_LINE (failed instance creation)
276276 }
277277 atomlist_cast ( ptr.get () )->pointer = new CAtomPointer ();
278278 return ptr.release ();
@@ -439,13 +439,13 @@ AtomList::New( Py_ssize_t size, CAtom* atom, Member* validator )
439439bool AtomList::Ready ()
440440{
441441 if ( !ListMethods::init_methods () ) {
442- return false ;
442+ return false ; // LCOV_EXCL_LINE (failed method lookup, impossible)
443443 }
444444 // The reference will be handled by the module to which we will add the type
445445 TypeObject = pytype_cast ( PyType_FromSpec ( &TypeObject_Spec ) );
446446 if ( !TypeObject )
447447 {
448- return false ;
448+ return false ; // LCOV_EXCL_LINE (failed type creation)
449449 }
450450 return true ;
451451}
@@ -497,122 +497,122 @@ init_containerlistchange()
497497 PySStr::typestr = PyUnicode_InternFromString ( " type" );
498498 if ( !PySStr::typestr )
499499 {
500- return false ;
500+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
501501 }
502502 PySStr::namestr = PyUnicode_InternFromString ( " name" );
503503 if ( !PySStr::namestr )
504504 {
505- return false ;
505+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
506506 }
507507 PySStr::objectstr = PyUnicode_InternFromString ( " object" );
508508 if ( !PySStr::objectstr )
509509 {
510- return false ;
510+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
511511 }
512512 PySStr::valuestr = PyUnicode_InternFromString ( " value" );
513513 if ( !PySStr::valuestr )
514514 {
515- return false ;
515+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
516516 }
517517 PySStr::operationstr = PyUnicode_InternFromString ( " operation" );
518518 if ( !PySStr::operationstr )
519519 {
520- return false ;
520+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
521521 }
522522 PySStr::itemstr = PyUnicode_InternFromString ( " item" );
523523 if ( !PySStr::itemstr )
524524 {
525- return false ;
525+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
526526 }
527527 PySStr::itemsstr = PyUnicode_InternFromString ( " items" );
528528 if ( !PySStr::itemsstr )
529529 {
530- return false ;
530+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
531531 }
532532 PySStr::indexstr = PyUnicode_InternFromString ( " index" );
533533 if ( !PySStr::indexstr )
534534 {
535- return false ;
535+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
536536 }
537537 PySStr::keystr = PyUnicode_InternFromString ( " key" );
538538 if ( !PySStr::keystr )
539539 {
540- return false ;
540+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
541541 }
542542 PySStr::reversestr = PyUnicode_InternFromString ( " reverse" );
543543 if ( !PySStr::reversestr )
544544 {
545- return false ;
545+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
546546 }
547547 PySStr::containerstr = PyUnicode_InternFromString ( " container" );
548548 if ( !PySStr::containerstr )
549549 {
550- return false ;
550+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
551551 }
552552 PySStr::__delitem__str = PyUnicode_InternFromString ( " __delitem__" );
553553 if ( !PySStr::typestr )
554554 {
555- return false ;
555+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
556556 }
557557 PySStr::__iadd__str = PyUnicode_InternFromString ( " __iadd__" );
558558 if ( !PySStr::__iadd__str )
559559 {
560- return false ;
560+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
561561 }
562562 PySStr::__imul__str = PyUnicode_InternFromString ( " __imul__" );
563563 if ( !PySStr::__imul__str )
564564 {
565- return false ;
565+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
566566 }
567567 PySStr::__setitem__str = PyUnicode_InternFromString ( " __setitem__" );
568568 if ( !PySStr::__setitem__str )
569569 {
570- return false ;
570+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
571571 }
572572 PySStr::appendstr = PyUnicode_InternFromString ( " append" );
573573 if ( !PySStr::appendstr )
574574 {
575- return false ;
575+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
576576 }
577577 PySStr::extendstr = PyUnicode_InternFromString ( " extend" );
578578 if ( !PySStr::extendstr )
579579 {
580- return false ;
580+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
581581 }
582582 PySStr::insertstr = PyUnicode_InternFromString ( " insert" );
583583 if ( !PySStr::insertstr )
584584 {
585- return false ;
585+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
586586 }
587587 PySStr::popstr = PyUnicode_InternFromString ( " pop" );
588588 if ( !PySStr::popstr )
589589 {
590- return false ;
590+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
591591 }
592592 PySStr::removestr = PyUnicode_InternFromString ( " remove" );
593593 if ( !PySStr::removestr )
594594 {
595- return false ;
595+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
596596 }
597597 PySStr::sortstr = PyUnicode_InternFromString ( " sort" );
598598 if ( !PySStr::sortstr )
599599 {
600- return false ;
600+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
601601 }
602602 PySStr::olditemstr = PyUnicode_InternFromString ( " olditem" );
603603 if ( !PySStr::olditemstr )
604604 {
605- return false ;
605+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
606606 }
607607 PySStr::newitemstr = PyUnicode_InternFromString ( " newitem" );
608608 if ( !PySStr::newitemstr )
609609 {
610- return false ;
610+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
611611 }
612612 PySStr::countstr = PyUnicode_InternFromString ( " count" );
613613 if ( !PySStr::countstr )
614614 {
615- return false ;
615+ return false ; // LCOV_EXCL_LINE (failed interned string creation)
616616 }
617617 alloced = true ;
618618 return true ;
@@ -1205,15 +1205,15 @@ bool AtomCList::Ready()
12051205 // Ensure the parent type was created
12061206 if ( !AtomList::TypeObject )
12071207 {
1208- return false ;
1208+ return false ; // LCOV_EXCL_LINE (parent type not created, impossible)
12091209 }
12101210 AtomCList_Type_slots[0 ].pfunc = void_cast ( AtomList::TypeObject );
12111211
12121212 // The reference will be handled by the module to which we will add the type
12131213 TypeObject = pytype_cast ( PyType_FromSpec ( &TypeObject_Spec ) );
12141214 if ( !TypeObject )
12151215 {
1216- return false ;
1216+ return false ; // LCOV_EXCL_LINE (failed type creation)
12171217 }
12181218 return true ;
12191219}
0 commit comments