-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Bug report
Bug description:
The following is not a valid Python input clinic but should be:
/*[python input]
print("/* this is a comment *\/")
[python start generated code]*/
Note that the inner C comment should be *\/
because otherwise IDEs will consider the block comment to be closed resulting in syntax errors (for the C file). Another example is just:
/*[python input]
x = "/*"
[python start generated code]*/
Both result in the following error (I've just added the AC directive in the first file I had opened):
$ python3 ./Tools/clinic/clinic.py --force --make --exclude Lib/test/clinic.test.c --srcdir .
Error in file 'Modules/sha1module.c' on line 270:
Nested block comment!
make: *** [Makefile:1055: clinic] Error 1
For now the workaround is to break /*
into multiple strings: x = "/" + "*"
for instance.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response