Skip to content

Commit e92d393

Browse files
ammaraskarzware
authored andcommitted
Fix compiler warning on Windows (GH-18012)
Python-ast.h contains a macro named Yield that conflicts with the Yield macro in Windows system headers. While Python-ast.h has an "undef Yield" directive to prevent this, it means that Python-ast.h must be included before Windows header files or we run into a re-declaration warning. In commit c96be81 an include for pycore_pystate.h was added which indirectly includes Windows header files. In this commit we re-order the includes to fix this warning.
1 parent e85a305 commit e92d393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#include "Python.h"
2525

26-
#include "Python-ast.h"
2726
#include "pycore_pystate.h" /* _PyInterpreterState_GET_UNSAFE() */
27+
#include "Python-ast.h"
2828
#include "ast.h"
2929
#include "code.h"
3030
#include "symtable.h"

0 commit comments

Comments
 (0)