8000 gh-117398: Isolate _datetime (3.13.0a6 PoC) by neonene · Pull Request #117498 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117398: Isolate _datetime (3.13.0a6 PoC) #117498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test_datetime_capi() for multi-phase init
  • Loading branch information
neonene committed Apr 3, 2024
commit 501c3e91805d117bb149aa546098bd24be71d32d
16 changes: 2 additions & 14 deletions Modules/_testcapi/datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@
#include "datetime.h" // PyDateTimeAPI


static int test_run_counter = 0;

static PyObject *
test_datetime_capi(PyObject *self, PyObject *args)
{
if (PyDateTimeAPI) {
if (test_run_counter) {
/* Probably regrtest.py -R */
Py_RETURN_NONE;
}
else {
PyErr_SetString(PyExc_AssertionError,
"PyDateTime_CAPI somehow initialized");
return NULL;
}
}
test_run_counter++;
// PyDateTimeAPI cannot be carried over
// with multi-phase init enabled.
PyDateTime_IMPORT;

if (PyDateTimeAPI) {
Expand Down
0