From 72368edd26c4da7460091c373305ab544c41b90e Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Wed, 29 Oct 2025 14:51:33 +0000 Subject: [PATCH] make windows happy --- Include/internal/pycore_code.h | 4 ---- Python/ceval.c | 4 ++++ Python/specialize.c | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index 434f47374f79..7970d674440c 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -674,10 +674,6 @@ extern PyObject* _PyCode_ConstantKey(PyObject *obj); #define NO_LOC_4 (128 | (PY_CODE_LOCATION_INFO_NONE << 3) | 3) -static const PyBytesObject no_location = { - PyVarObject_HEAD_INIT(&PyBytes_Type, 1) - .ob_sval = { NO_LOC_4 } -}; #ifdef __cplusplus } diff --git a/Python/ceval.c b/Python/ceval.c index f2dd8fc6e8d7..09fd30b0c8a0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -931,6 +931,10 @@ int _Py_CheckRecursiveCallPy( return 0; } +static const PyBytesObject no_location = { + PyVarObject_HEAD_INIT(&PyBytes_Type, 1) + .ob_sval = { NO_LOC_4 } +}; #ifdef Py_GIL_DISABLED static _PyCodeArray emtry_cleanup_tlbc = { diff --git a/Python/specialize.c b/Python/specialize.c index 0583873e09d2..8a7ba00e2e10 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -3204,6 +3204,11 @@ static _PyCodeArray init_cleanup_tlbc = { }; #endif +static const PyBytesObject no_location = { + PyVarObject_HEAD_INIT(&PyBytes_Type, 1) + .ob_sval = { NO_LOC_4 } +}; + const struct _PyCode8 _Py_InitCleanup = { _PyVarObject_HEAD_INIT(&PyCode_Type, 3), .co_consts = (PyObject *)&_Py_SINGLETON(tuple_empty), -- 2.47.3