mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Better error message
This commit is contained in:
parent
2eef126e68
commit
ab93b6cde3
@ -121,9 +121,9 @@ static PyObject*
|
|||||||
speedup_detach(PyObject *self, PyObject *args) {
|
speedup_detach(PyObject *self, PyObject *args) {
|
||||||
char *devnull = NULL;
|
char *devnull = NULL;
|
||||||
if (!PyArg_ParseTuple(args, "s", &devnull)) return NULL;
|
if (!PyArg_ParseTuple(args, "s", &devnull)) return NULL;
|
||||||
if (freopen(devnull, "r", stdin) == NULL) return PyErr_SetFromErrno(PyExc_EnvironmentError);
|
if (freopen(devnull, "r", stdin) == NULL) return PyErr_SetFromErrnoWithFilename(PyExc_OSError, devnull);
|
||||||
if (freopen(devnull, "w", stdout) == NULL) return PyErr_SetFromErrno(PyExc_EnvironmentError);
|
if (freopen(devnull, "w", stdout) == NULL) return PyErr_SetFromErrnoWithFilename(PyExc_OSError, devnull);
|
||||||
if (freopen(devnull, "w", stderr) == NULL) return PyErr_SetFromErrno(PyExc_EnvironmentError);
|
if (freopen(devnull, "w", stderr) == NULL) return PyErr_SetFromErrnoWithFilename(PyExc_OSError, devnull);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user