STINNER Victor <[email protected]> added the comment:
Current comment in Objects/dictobject.c:
/* We can arrive here with a NULL tstate during initialization: try
running "python -Wi" for an example related to string interning.
Let's just hope that no exception occurs then... This must be
_PyThreadState_GET() and not PyThreadState_Get() because the latter
abort Python if tstate is NULL. */
PyDict_GetItem() is no longer called before Py_Initialize(). I reworked the
Python startup to no longer use Python objects before Py_Initialize(): see PEP
587 (PyConfig).
> To help C extension modules authors, I propose to keep a check at the runtime
> even in release build. Later, we may drop this check in release mode and only
> keep it in debug mode.
Hum, since the whole test pass with the change and it was not documented that
it was possible to call the function with the GIL released, I changed my mind
and only kept the runtime check in debug mode.
----------
nosy: +eric.snow, ncoghlan
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com