Skip to content
Merged
Prev Previous commit
Next Next commit
Revert "Return the main thread's short identifier on certain platforms"
This reverts commit 51d6579.
  • Loading branch information
vfazio committed Feb 23, 2025
commit 7bdfd34cdfc44eb8a8a3c1e799da43101af3f155
7 changes: 0 additions & 7 deletions Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,13 +2029,6 @@ An obsolete synonym of allocate_lock().");
static PyObject *
thread_get_ident(PyObject *self, PyObject *Py_UNUSED(ignored))
{
/* Work around an issue with the main thread ID to failing comparison checks
due to sign extension on some Linux libc implemenations. Can be removed
when thread identifiers are reworked. */
#if SIZEOF_LONG < SIZEOF_LONG_LONG && defined(__linux__) && !defined(__GLIBC__)
if (_Py_IsMainThread())
return PyLong_FromUnsignedLong(_PyRuntime.main_thread);
#endif
PyThread_ident_t ident = PyThread_get_thread_ident_ex();
if (ident == PYTHREAD_INVALID_THREAD_ID) {
PyErr_SetString(ThreadError, "no current thread ident");
Expand Down