Skip to content

Commit 501c3e9

Browse files
committed
test_datetime_capi() for multi-phase init
1 parent bfab79f commit 501c3e9

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Modules/_testcapi/datetime.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,11 @@
33
#include "datetime.h" // PyDateTimeAPI
44

55

6-
static int test_run_counter = 0;
7-
86
static PyObject *
97
test_datetime_capi(PyObject *self, PyObject *args)
108
{
11-
if (PyDateTimeAPI) {
12-
if (test_run_counter) {
13-
/* Probably regrtest.py -R */
14-
Py_RETURN_NONE;
15-
}
16-
else {
17-
PyErr_SetString(PyExc_AssertionError,
18-
"PyDateTime_CAPI somehow initialized");
19-
return NULL;
20-
}
21-
}
22-
test_run_counter++;
9+
// PyDateTimeAPI cannot be carried over
10+
// with multi-phase init enabled.
2311
PyDateTime_IMPORT;
2412

2513
if (PyDateTimeAPI) {

0 commit comments

Comments
 (0)