##// END OF EJS Templates
inotify: _inotify.c: bugfix: remove_watch has to return PyNone on success...
Nicolas Dumazet -
r9428:5d6659cf default
parent child Browse files
Show More
@@ -106,13 +106,12 b' PyDoc_STRVAR('
106
106
107 static PyObject *remove_watch(PyObject *self, PyObject *args)
107 static PyObject *remove_watch(PyObject *self, PyObject *args)
108 {
108 {
109 PyObject *ret = NULL;
110 uint32_t wd;
109 uint32_t wd;
111 int fd;
110 int fd;
112 int r;
111 int r;
113
112
114 if (!PyArg_ParseTuple(args, "iI:remove_watch", &fd, &wd))
113 if (!PyArg_ParseTuple(args, "iI:remove_watch", &fd, &wd))
115 goto bail;
114 return NULL;
116
115
117 Py_BEGIN_ALLOW_THREADS
116 Py_BEGIN_ALLOW_THREADS
118 r = inotify_rm_watch(fd, wd);
117 r = inotify_rm_watch(fd, wd);
@@ -120,18 +119,11 b' static PyObject *remove_watch(PyObject *'
120
119
121 if (r == -1) {
120 if (r == -1) {
122 PyErr_SetFromErrno(PyExc_OSError);
121 PyErr_SetFromErrno(PyExc_OSError);
123 goto bail;
122 return NULL;
124 }
123 }
125
124
126 Py_INCREF(Py_None);
125 Py_INCREF(Py_None);
127
126 return Py_None;
128 goto done;
129
130 bail:
131 Py_CLEAR(ret);
132
133 done:
134 return ret;
135 }
127 }
136
128
137 PyDoc_STRVAR(
129 PyDoc_STRVAR(
General Comments 0
You need to be logged in to leave comments. Login now