mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.13] gh-117482: Fix the Slot Wrapper Inheritance Tests (gh-122249)
The tests were only checking cases where the slot wrapper was present in the initial case. They were missing when the slot wrapper was added in the additional initializations. This fixes that.
(cherry-picked from commit 490e0ad83a
, AKA gh-122248)
This commit is contained in:
parent
b5e8b10de7
commit
10cf7d6d00
5 changed files with 131 additions and 51 deletions
|
@ -170,15 +170,23 @@ PyInit_embedded_ext(void)
|
|||
static int test_repeated_init_exec(void)
|
||||
{
|
||||
if (main_argc < 3) {
|
||||
fprintf(stderr, "usage: %s test_repeated_init_exec CODE\n", PROGRAM);
|
||||
fprintf(stderr,
|
||||
"usage: %s test_repeated_init_exec CODE ...\n", PROGRAM);
|
||||
exit(1);
|
||||
}
|
||||
const char *code = main_argv[2];
|
||||
int loops = main_argc > 3
|
||||
? main_argc - 2
|
||||
: INIT_LOOPS;
|
||||
|
||||
for (int i=1; i <= INIT_LOOPS; i++) {
|
||||
fprintf(stderr, "--- Loop #%d ---\n", i);
|
||||
for (int i=0; i < loops; i++) {
|
||||
fprintf(stderr, "--- Loop #%d ---\n", i+1);
|
||||
fflush(stderr);
|
||||
|
||||
if (main_argc > 3) {
|
||||
code = main_argv[i+2];
|
||||
}
|
||||
|
||||
_testembed_Py_InitializeFromConfig();
|
||||
int err = PyRun_SimpleString(code);
|
||||
Py_Finalize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue