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
PEP 7
  • Loading branch information
neonene committed Apr 3, 2024
commit d11c46a1c7290cf020e4aeb274ecce6565d2a829
6 changes: 4 additions & 2 deletions Include/datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,16 @@ typedef struct {
/* Define global variable for the C API and a macro for setting it. */
static PyDateTime_CAPI *_pydatetimeapi_main = NULL;

static inline void _import_pydatetime(void) {
static inline void
_import_pydatetime(void) {
if (PyInterpreterState_Get() == PyInterpreterState_Main()) {
_pydatetimeapi_main = PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0);
}
}
#define PyDateTime_IMPORT _import_pydatetime()

static inline PyDateTime_CAPI *_get_pydatetime_api(void) {
static inline PyDateTime_CAPI *
_get_pydatetime_api(void) {
if (PyInterpreterState_Get() == PyInterpreterState_Main()) {
return _pydatetimeapi_main;
}
Expand Down