| 64 | } |
| 65 | |
| 66 | char* |
| 67 | pgit_borrow_fsdefault(PyObject *value, PyObject **tvalue) |
| 68 | { |
| 69 | PyObject *str = PyOS_FSPath(value); |
| 70 | if (str == NULL) { |
| 71 | return NULL; |
| 72 | } |
| 73 | |
| 74 | PyObject *bytes = PyUnicode_EncodeFSDefault(str); |
| 75 | if (bytes == NULL) { |
| 76 | return NULL; |
| 77 | } |
| 78 | |
| 79 | *tvalue = bytes; |
| 80 | return PyBytes_AS_STRING(bytes); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Return a pointer to the underlying C string in 'value'. The pointer is |
no outgoing calls
no test coverage detected
searching dependent graphs…