File tree 1 file changed +2
-3
lines changed 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1111,7 +1111,8 @@ def output_templates(
1111
1111
if include :
1112
1112
clinic .add_include (include .filename , include .reason ,
1113
1113
condition = include .condition )
1114
-
1114
+ if f .critical_section :
1115
+ clinic .add_include ('pycore_critical_section.h' , 'Py_BEGIN_CRITICAL_SECTION()' )
1115
1116
has_option_groups = parameters and (parameters [0 ].group or parameters [- 1 ].group )
1116
1117
simple_return = (f .return_converter .type == 'PyObject *'
1117
1118
and not f .critical_section )
@@ -5306,8 +5307,6 @@ def at_critical_section(self, *args: str) -> None:
5306
5307
fail ("Up to 2 critical section variables are supported" )
5307
5308
self .target_critical_section .extend (args )
5308
5309
self .critical_section = True
5309
- if self .critical_section :
5310
- clinic .add_include ('pycore_critical_section.h' , 'Py_BEGIN_CRITICAL_SECTION()' )
5311
5310
5312
5311
def at_staticmethod (self ) -> None :
5313
5312
if self .kind is not CALLABLE :
You can’t perform that action at this time.
0 commit comments