Skip to content

Commit 0ca9fc7

Browse files
committed
improve error message.
1 parent f6a7b6e commit 0ca9fc7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Modules/posixmodule.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6818,8 +6818,16 @@ static void warn_about_fork_with_threads(const char* name) {
68186818
if (num_python_threads > 1) {
68196819
PyErr_WarnFormat(
68206820
PyExc_DeprecationWarning, 1,
6821-
"multi-threaded process detected, "
6822-
"use of %s() may lead to deadlocks in the child.", name);
6821+
#ifdef HAVE_GETPID
6822+
"This process (pid=%d) is multi-threaded, "
6823+
#else
6824+
"This process is multi-threaded, "
6825+
#endif
6826+
"use of %s() may lead to deadlocks in the child.",
6827+
#ifdef HAVE_GETPID
6828+
getpid(),
6829+
#endif
6830+
name);
68236831
PyErr_Clear();
68246832
}
68256833
}

0 commit comments

Comments
 (0)