File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,15 @@ typedef struct _Py_Identifier {
4141 Py_ssize_t index ;
4242} _Py_Identifier ;
4343
44- #if defined( NEEDS_PY_IDENTIFIER ) || !defined( Py_BUILD_CORE )
44+ #ifndef Py_BUILD_CORE
4545// For now we are keeping _Py_IDENTIFIER for continued use
4646// in non-builtin extensions (and naughty PyPI modules).
4747
4848#define _Py_static_string_init (value ) { .string = (value), .index = -1 }
4949#define _Py_static_string (varname , value ) static _Py_Identifier varname = _Py_static_string_init(value)
5050#define _Py_IDENTIFIER (varname ) _Py_static_string(PyId_##varname, #varname)
5151
52- #endif /* NEEDS_PY_IDENTIFIER */
52+ #endif /* !Py_BUILD_CORE */
5353
5454typedef struct {
5555 /* Number implementations must check *both*
Original file line number Diff line number Diff line change 11#ifndef Py_BUILD_CORE_MODULE
22# define Py_BUILD_CORE_MODULE
33#endif
4- #define NEEDS_PY_IDENTIFIER
54
65/* Always enable assertion (even in release mode) */
76#undef NDEBUG
@@ -1891,7 +1890,11 @@ static int test_unicode_id_init(void)
18911890{
18921891 // bpo-42882: Test that _PyUnicode_FromId() works
18931892 // when Python is initialized multiples times.
1894- _Py_IDENTIFIER (test_unicode_id_init );
1893+
1894+ static _Py_Identifier PyId_test_unicode_id_init = {
1895+ .string = "test_unicode_id_init" ,
1896+ .index = -1 ,
1897+ };
18951898
18961899 // Initialize Python once without using the identifier
18971900 _testembed_Py_InitializeFromConfig ();
You can’t perform that action at this time.
0 commit comments