| 71 | } |
| 72 | |
| 73 | bool closed() const { |
| 74 | if (!file_) { |
| 75 | return true; |
| 76 | } |
| 77 | PyObject* result = PyObject_GetAttrString(file_.obj(), "closed"); |
| 78 | if (result == NULL) { |
| 79 | // Can't propagate the error, so write it out and return an arbitrary value |
| 80 | PyErr_WriteUnraisable(NULL); |
| 81 | return true; |
| 82 | } |
| 83 | int ret = PyObject_IsTrue(result); |
| 84 | Py_XDECREF(result); |
| 85 | if (ret < 0) { |
| 86 | PyErr_WriteUnraisable(NULL); |
| 87 | return true; |
| 88 | } |
| 89 | return ret != 0; |
| 90 | } |
| 91 | |
| 92 | Status Seek(int64_t position, int whence) { |
| 93 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no outgoing calls
no test coverage detected