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 0fe9a76..d2299aa 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; |