diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-05-09 23:03:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 23:03:46 (GMT) |
commit | 6ed7c353b8ded48a9128413f35921ddc4e5b1065 (patch) | |
tree | afc47815078dc4b9eb7bc1ca47b97be3ebabcaac /Python/thread.c | |
parent | 22bddc864d3cc04ed218beb3b706ff1790db836a (diff) | |
download | cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.zip cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.tar.gz cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.tar.bz2 |
gh-88750: Remove the PYTHONTHREADDEBUG env var support. (#92509)
Remove the `PYTHONTHREADDEBUG` env var support.
Remove no-op dprintf() macro calls.
Diffstat (limited to 'Python/thread.c')
-rw-r--r-- | Python/thread.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Python/thread.c b/Python/thread.c index e80e8a9..846f025 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -42,14 +42,6 @@ #endif /* _POSIX_THREADS */ - -#ifdef Py_DEBUG -static int thread_debug = 0; -# define dprintf(args) (void)((thread_debug & 1) && printf args) -#else -# define dprintf(args) -#endif - static int initialized; static void PyThread__init_thread(void); /* Forward */ @@ -57,42 +49,12 @@ static void PyThread__init_thread(void); /* Forward */ void PyThread_init_thread(void) { -#ifdef Py_DEBUG - const char *p = Py_GETENV("PYTHONTHREADDEBUG"); - - if (p) { - if (*p) - thread_debug = atoi(p); - else - thread_debug = 1; - } -#endif /* Py_DEBUG */ if (initialized) return; initialized = 1; - dprintf(("PyThread_init_thread called\n")); PyThread__init_thread(); } -void -_PyThread_debug_deprecation(void) -{ -#ifdef Py_DEBUG - if (thread_debug) { - // Flush previous dprintf() logs - fflush(stdout); - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "The threading debug (PYTHONTHREADDEBUG environment " - "variable) is deprecated and will be removed " - "in Python 3.12", - 0)) - { - _PyErr_WriteUnraisableMsg("at Python startup", NULL); - } - } -#endif -} - #if defined(_POSIX_THREADS) # define PYTHREAD_NAME "pthread" # include "thread_pthread.h" |