Closed
Description
While reviewing a PR, @ambv and I stumbled over some weird AC error messages. After many frustrating minutes, we found that a single before [clinic start generated code]
generated error messages other places in the code.
Reproducers
Repro 1, add indent to clinic module and class declaration. The change is in line 35, but clinic.py complains about line 71.
$ git diff
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 0e903ade5b..5c1f2d4d87 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -32,7 +32,7 @@
/*[clinic input]
module _sqlite3
class _sqlite3.Cursor "pysqlite_Cursor *" "clinic_state()->CursorType"
-[clinic start generated code]*/
+ [clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c5b8115c5cf30f1]*/
/*
$ python3.11 Tools/clinic/clinic.py -f Modules/_sqlite/cursor.c
Error in file "Modules/_sqlite/cursor.c" on line 71:
Illegal function name: [clinic start generated code]*/
Repro 2, add indent to method clinic spec. The change is in line 66, but clinic.py complains about line 733.
$ git diff
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 0e903ade5b..e936e4c00a 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -63,7 +63,7 @@ _sqlite3.Cursor.__init__ as pysqlite_cursor_init
connection: object(type='pysqlite_Connection *', subclass_of='clinic_state()->ConnectionType')
/
-[clinic start generated code]*/
+ [clinic start generated code]*/
static int
pysqlite_cursor_init_impl(pysqlite_Cursor *self,
$ python3.11 Tools/clinic/clinic.py -f Modules/_sqlite/cursor.c
Error in file "Modules/_sqlite/cursor.c" on line 733:
Illegal outdent.