]> granicus.if.org Git - python/commitdiff
reinit the TLS before anything else (#130)
authorBenjamin Peterson <benjamin@python.org>
Tue, 21 Feb 2017 07:43:15 +0000 (23:43 -0800)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2017 07:43:15 +0000 (23:43 -0800)
PyEval_ReInitThread can run arbitrary Python code, which really ought to have
the TLS initialized.

Parser/intrcheck.c

index 1c888a598e9d0366d434325078f9eebf30a5ce55..5844a9a85e16c5b424563c4e8e82d4c45a700ab7 100644 (file)
@@ -172,7 +172,7 @@ void
 PyOS_AfterFork(void)
 {
 #ifdef WITH_THREAD
-    PyEval_ReInitThreads();
     PyThread_ReInitTLS();
+    PyEval_ReInitThreads();
 #endif
 }