Skip to content

Commit 3482918

Browse files
committed
gh-135427: check that exception occured, and also clear later the exception.
1 parent 6622c55 commit 3482918

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/posixmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8086,7 +8086,10 @@ warn_about_fork_with_threads(const char* name)
80868086
getpid(),
80878087
#endif
80888088
name);
8089-
PyErr_WriteUnraisable(NULL);
8089+
if (PyErr_Occurred()) {
8090+
PyErr_WriteUnraisable(NULL);
8091+
PyErr_Clear();
8092+
}
80908093
}
80918094
}
80928095
#endif // HAVE_FORK1 || HAVE_FORKPTY || HAVE_FORK

0 commit comments

Comments
 (0)