Skip to content

Commit 46159d2

Browse files
committed
Adapt to changed formatting of a rejected result in Python 3.12
--HG-- branch : 1.9
1 parent 58cd8e2 commit 46159d2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

plugins/python/regress/testhelpers.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,15 @@ verify_log_lines(const char *reference_path)
268268
// Convert ": REJECT" to ": 0" + rest of line
269269
memcpy(cp, ": 0", 3);
270270
memmove(cp + 3, cp + 8, strlen(cp + 8) + 1);
271+
} else {
272+
// Python 3.12 may use <RC.REJECT: 0> instead of 0
273+
cp = strstr(line_data, "<RC.REJECT: 0>");
274+
if (cp != NULL) {
275+
*cp = '0';
276+
memmove(cp + 1, cp + 14, strlen(cp + 14) + 1);
277+
}
271278
}
279+
272280
}
273281

274282
VERIFY_TRUE(strlcat(stored_str, line_data, sizeof(stored_str)) < sizeof(stored_str)); // we have enough space in buffer

0 commit comments

Comments
 (0)