Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ca0c6c

Browse files
committed
gh-84808: Handle errors returned by internal_connect()
Python shouldn't assume that errno codes are positive.reported and proposed by Ryan C. Gordon
1 parentd9efa45 commit2ca0c6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Modules/socketmodule.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,7 +3489,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
34893489
}
34903490

34913491
res=internal_connect(s,SAS2SA(&addrbuf),addrlen,1);
3492-
if (res<0)
3492+
if (res==-1)
34933493
returnNULL;
34943494

34953495
Py_RETURN_NONE;
@@ -3520,7 +3520,7 @@ sock_connect_ex(PySocketSockObject *s, PyObject *addro)
35203520
}
35213521

35223522
res=internal_connect(s,SAS2SA(&addrbuf),addrlen,0);
3523-
if (res<0)
3523+
if (res==-1)
35243524
returnNULL;
35253525

35263526
returnPyLong_FromLong((long)res);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp