@@ -23,15 +23,14 @@ class extension's methods in a json format (used as input by the template to gen
2323
2424The drawback is Cython doesn't provide a public API to plug into it compilation pipeline so
2525we have no guarantee this will not break in the future (but this part Cython is very central
26- so it's highly inlikely to change).
26+ so it's highly unlikely to change).
2727"""
2828
2929from typing import Optional
3030from dataclasses import dataclass
3131from Cython .Compiler .ParseTreeTransforms import NormalizeTree
3232from Cython .Compiler .Visitor import CythonTransform
3333import Cython .Compiler .Pipeline
34- from Cython .Compiler .Pipeline import dumptree
3534from Cython .Compiler .Errors import error
3635from Cython .Compiler .PyrexTypes import CIntType
3736from Cython .Compiler import Nodes , ExprNodes
@@ -43,14 +42,12 @@ class extension's methods in a json format (used as input by the template to gen
4342
4443
4544def patch_cython_pipeline ():
46-
4745 global _pipeline_patched
4846 assert not _pipeline_patched # Sanity check to avoid double patching
4947
5048 vanilla_create_pipeline = Cython .Compiler .Pipeline .create_pipeline
5149
5250 def godot_python_patched_create_pipeline (context , mode , exclude_classes = ()):
53-
5451 stages = vanilla_create_pipeline (context , mode , exclude_classes )
5552 index = next (i + 1 for i , x in enumerate (stages ) if isinstance (x , NormalizeTree ))
5653 stages .insert (index , GodotExtensionClassAttributes (context ))
@@ -183,7 +180,7 @@ def visit_CClassDefNode(self, node):
183180 error (arg .key .pos , f"unknown param `{ arg .key .value } `" )
184181 return node
185182 if not isinstance (arg .value , ExprNodes .UnicodeNode ):
186- error (arg .value .pos , f "param `parent` must be a unicode literal" )
183+ error (arg .value .pos , "param `parent` must be a unicode literal" )
187184 return node
188185 parent_class_name = arg .value .value
189186
@@ -302,7 +299,7 @@ def _extract_method_spec(method_node) -> MethodSpec:
302299 isinstance (arg_node .declarator , Nodes .CNameDeclaratorNode )
303300 and arg_node .declarator .name == ""
304301 ):
305- error (arg_node .pos , f "type required" )
302+ error (arg_node .pos , "type required" )
306303 return
307304 if isinstance (arg_node .declarator , Nodes .CPtrDeclaratorNode ):
308305 arg_type_name = f"{ arg_node .base_type .name } *"
0 commit comments