Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8ad024

Browse files
committed
Add 'return' keyword before error calls.
1 parent 74fb303 commit b8ad024

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Modules/termios.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ termios_tcgetattr(self, args)
3333
return NULL;
3434

3535
if (tcgetattr(fd, &mode) == -1)
36-
PyErr_SetFromErrno(TermiosError);
36+
return PyErr_SetFromErrno(TermiosError);
3737

3838
ispeed = cfgetispeed(&mode);
3939
ospeed = cfgetospeed(&mode);
@@ -133,11 +133,11 @@ termios_tcsetattr(self, args)
133133
}
134134

135135
if (cfsetispeed(&mode, (speed_t) ispeed) == -1)
136-
PyErr_SetFromErrno(TermiosError);
136+
return PyErr_SetFromErrno(TermiosError);
137137
if (cfsetospeed(&mode, (speed_t) ospeed) == -1)
138-
PyErr_SetFromErrno(TermiosError);
138+
return PyErr_SetFromErrno(TermiosError);
139139
if (tcsetattr(fd, when, &mode) == -1)
140-
PyErr_SetFromErrno(TermiosError);
140+
return PyErr_SetFromErrno(TermiosError);
141141

142142
Py_INCREF(Py_None);
143143
return Py_None;
@@ -156,7 +156,7 @@ termios_tcsendbreak(self, args)
156156
if (!PyArg_Parse(args, "(ii)", &fd, &duration))
157157
return NULL;
158158
if (tcsendbreak(fd, duration) == -1)
159-
PyErr_SetFromErrno(TermiosError);
159+
return PyErr_SetFromErrno(TermiosError);
160160

161161
Py_INCREF(Py_None);
162162
return Py_None;
@@ -176,7 +176,7 @@ termios_tcdrain(self, args)
176176
if (!PyArg_Parse(args, "i", &fd))
177177
return NULL;
178178
if (tcdrain(fd) == -1)
179-
PyErr_SetFromErrno(TermiosError);
179+
return PyErr_SetFromErrno(TermiosError);
180180

181181
Py_INCREF(Py_None);
182182
return Py_None;
@@ -196,7 +196,7 @@ termios_tcflush(self, args)
196196
if (!PyArg_Parse(args, "(ii)", &fd, &queue))
197197
return NULL;
198198
if (tcflush(fd, queue) == -1)
199-
PyErr_SetFromErrno(TermiosError);
199+
return PyErr_SetFromErrno(TermiosError);
200200

201201
Py_INCREF(Py_None);
202202
return Py_None;
@@ -216,7 +216,7 @@ termios_tcflow(self, args)
216216
if (!PyArg_Parse(args, "(ii)", &fd, &action))
217217
return NULL;
218218
if (tcflow(fd, action) == -1)
219-
PyErr_SetFromErrno(TermiosError);
219+
return PyErr_SetFromErrno(TermiosError);
220220

221221
Py_INCREF(Py_None);
222222
return Py_None;

0 commit comments

Comments
 (0)