Todd Fiala | 9bb71b7 | 2014-02-26 07:39:20 +0000 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include "Python.h" |
| 3 | |
| 4 | // Python readline module intentionally built to not implement the |
| 5 | // readline module interface. This is meant to work around llvm |
| 6 | // pr18841 to avoid seg faults in the stock Python readline.so linked |
| 7 | // against GNU readline. |
| 8 | |
| 9 | static struct PyMethodDef moduleMethods[] = |
| 10 | { |
Todd Fiala | 34413ec | 2014-06-26 22:35:36 +0000 | [diff] [blame] | 11 | {nullptr, nullptr, 0, nullptr} |
Todd Fiala | 9bb71b7 | 2014-02-26 07:39:20 +0000 | [diff] [blame] | 12 | }; |
| 13 | |
| 14 | PyDoc_STRVAR( |
| 15 | moduleDocumentation, |
| 16 | "Stub module meant to effectively disable readline support."); |
| 17 | |
| 18 | PyMODINIT_FUNC |
| 19 | initreadline(void) |
| 20 | { |
| 21 | Py_InitModule4( |
| 22 | "readline", |
| 23 | moduleMethods, |
| 24 | moduleDocumentation, |
| 25 | static_cast<PyObject *>(NULL), |
| 26 | PYTHON_API_VERSION); |
| 27 | } |