gh-151763: Fix crash in PyList_New() on allocation failure under low memory (#154019) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>