Mercurial > cpython-lru_cache-weakref
comparison Python/thread.c @ 84793:fc718c177ee6
Issue #18520: Add a new PyStructSequence_InitType2() function, same than
PyStructSequence_InitType() except that it has a return value (0 on success,
-1 on error).
* PyStructSequence_InitType2() now raises MemoryError on memory allocation failure
* Fix also some calls to PyDict_SetItemString(): handle error
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Mon, 22 Jul 2013 22:24:54 +0200 |
| parents | 18bb92b0c458 |
| children |
comparison
equal
deleted
inserted
replaced
| 84792:ffe9d73b5f8d | 84793:fc718c177ee6 |
|---|---|
| 397 && defined(_CS_GNU_LIBPTHREAD_VERSION)) | 397 && defined(_CS_GNU_LIBPTHREAD_VERSION)) |
| 398 char buffer[255]; | 398 char buffer[255]; |
| 399 int len; | 399 int len; |
| 400 #endif | 400 #endif |
| 401 | 401 |
| 402 if (ThreadInfoType.tp_name == 0) | 402 if (ThreadInfoType.tp_name == 0) { |
| 403 PyStructSequence_InitType(&ThreadInfoType, &threadinfo_desc); | 403 if (PyStructSequence_InitType2(&ThreadInfoType, &threadinfo_desc) < 0) |
| 404 return NULL; | |
| 405 } | |
| 404 | 406 |
| 405 threadinfo = PyStructSequence_New(&ThreadInfoType); | 407 threadinfo = PyStructSequence_New(&ThreadInfoType); |
| 406 if (threadinfo == NULL) | 408 if (threadinfo == NULL) |
| 407 return NULL; | 409 return NULL; |
| 408 | 410 |
