diff options
Diffstat (limited to 'Modules/threadmodule.c')
-rw-r--r-- | Modules/threadmodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c index 81bf288..a87ddb3 100644 --- a/Modules/threadmodule.c +++ b/Modules/threadmodule.c @@ -293,7 +293,10 @@ _ldict(localobject *self) } } - else if (self->dict != ldict) { + + /* The call to tp_init above may have caused another thread to run. + Install our ldict again. */ + if (self->dict != ldict) { Py_CLEAR(self->dict); Py_INCREF(ldict); self->dict = ldict; |