Skip to content

Commit 38ec6a9

Browse files
committed
Work around Windows Yield macro vs Python-ast.h
1 parent db48ddc commit 38ec6a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/ast.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
#include "ast.h"
1010
#include "token.h"
1111
#include "pythonrun.h"
12+
/* A Windows header defines its own Yield macro, so we don't use the one
13+
* from Python-ast.h and instead call _Py_Yield() directly. [ugh] */
14+
#undef Yield
1215
#include "internal/pystate.h"
16+
#undef Yield
1317

1418
#include <assert.h>
1519
#include <stdbool.h>
@@ -2703,7 +2707,7 @@ ast_for_expr(struct compiling *c, const node *n)
27032707
}
27042708
if (is_from)
27052709
return YieldFrom(exp, LINENO(n), n->n_col_offset, c->c_arena);
2706-
return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena);
2710+
return _Py_Yield(exp, LINENO(n), n->n_col_offset, c->c_arena);
27072711
}
27082712
case factor:
27092713
if (NCH(n) == 1) {

0 commit comments

Comments
 (0)