(self, content, line)
| 554 | return operations |
| 555 | |
| 556 | def add_line(self, content, line): |
| 557 | # Use the first matching newline |
| 558 | match = re.search(r'(?:\r\n|\n|\r)', content) |
| 559 | newline = match.group(0) if match else '\n' |
| 560 | |
| 561 | line = line + newline |
| 562 | # FIXME: tolerate trailing spaces |
| 563 | if line not in content: |
| 564 | # FIXME: add macro after the first header comment |
| 565 | # FIXME: add macro after includes |
| 566 | # FIXME: add macro after: #define PY_SSIZE_T_CLEAN |
| 567 | return line + newline + content |
| 568 | else: |
| 569 | return content |
| 570 | |
| 571 | def add_pythoncapi_compat(self, content): |
| 572 | if self._has_pythoncapi_compat: |
no outgoing calls
no test coverage detected