Combines the code fragments into source code ready to be compiled
(name, init, body)
| 167 | |
| 168 | |
| 169 | def _make_source(name, init, body): |
| 170 | """ Combines the code fragments into source code ready to be compiled |
| 171 | """ |
| 172 | code = f""" |
| 173 | #include <Python.h> |
| 174 | |
| 175 | {body} |
| 176 | |
| 177 | PyMODINIT_FUNC |
| 178 | PyInit_{name}(void) {{ |
| 179 | {init} |
| 180 | }} |
| 181 | """ |
| 182 | return code |
| 183 | |
| 184 | |
| 185 | def _c_compile(cfile, outputfilename, include_dirs, libraries, |
no outgoing calls
no test coverage detected
searching dependent graphs…