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

Skip to content

Commit 1af62db

Browse files
korliencukou
andauthored
Modules/socketmodule.c: error handling scheme (no raise)
Co-authored-by: Petr Viktorin <[email protected]>
1 parent cb2aed3 commit 1af62db

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/socketmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3490,8 +3490,10 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
34903490
}
34913491

34923492
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 1);
3493-
if (res == -1 && PyErr_Occurred())
3493+
if (res < 0) {
3494+
assert(PyErr_Occurred());
34943495
return NULL;
3496+
}
34953497

34963498
Py_RETURN_NONE;
34973499
}

0 commit comments

Comments
 (0)