https://github.com/python/cpython/commit/bd0913a8403db0238161a2eca09f9d52b36808c4
commit: bd0913a8403db0238161a2eca09f9d52b36808c4
branch: main
author: Inada Naoki <[email protected]>
committer: methane <[email protected]>
date: 2026-09-24T15:06:56+09:00
summary:

gh-157407: Fix a compilation error on Windows. (#158048)

`&PyUnicode_Type` cannot be determined at compile time on Windows.
Caused by #157393.

files:
M Parser/asdl_c.py
M Python/Python-ast.c

diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 93baea2130c889..2b83e97353bbf1 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -799,7 +799,7 @@ def visitModule(self, mod):
                     FIELD_SEQUENCE = 2,
                     FIELD_BUILTIN = 4,
                 };
-                static PyTypeObject *const builtin_types[] = {
+                PyTypeObject *const builtin_types[] = {
         '''))
         for c_type in builtins:
             self.emit(f"&{c_type},", 2)
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 2038b14811d3c0..0d89f7e87f1fa2 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -832,7 +832,7 @@ add_ast_annotations(struct ast_state *state)
         FIELD_SEQUENCE = 2,
         FIELD_BUILTIN = 4,
     };
-    static PyTypeObject *const builtin_types[] = {
+    PyTypeObject *const builtin_types[] = {
         &PyUnicode_Type,
         &PyLong_Type,
         &PyBaseObject_Type,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to