Issue #18874: make it more explicit than set_reentrant() only accept 0 or 1

This commit is contained in:
Victor Stinner 2013-11-26 01:08:53 +01:00
parent 7a5be14dd8
commit 2ead3d2448
1 changed files with 1 additions and 0 deletions

View File

@ -168,6 +168,7 @@ get_reentrant(void)
static void
set_reentrant(int reentrant)
{
assert(reentrant == 0 || reentrant == 1);
if (reentrant) {
assert(PyThread_get_key_value(tracemalloc_reentrant_key) == NULL);
PyThread_set_key_value(tracemalloc_reentrant_key,