Skip to content

Commit 38efc89

Browse files
committed
Clear CI error
1 parent 0d836c4 commit 38efc89

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Modules/socketmodule.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5575,15 +5575,14 @@ static PyType_Spec sock_spec = {
55755575
};
55765576

55775577
static PyObject*
5578-
socket_getattr(PyObject *mod, PyObject *name)
5578+
socket_getattr(PyObject *self, PyObject *name)
55795579
{
5580-
socket_state *state = get_module_state(mod);
5581-
5582-
if (PyUnicode_EqualToUTF8(name, "SocketType") && state != NULL) {
5580+
if (PyUnicode_EqualToUTF8(name, "SocketType")) {
5581+
socket_state *state = get_module_state(self);
55835582
PyErr_Warn(PyExc_DeprecationWarning, "_socket.SocketType is deprecated and "
55845583
"will be removed in Python 3.16. "
55855584
"Use socket.socket instead");
5586-
return state->sock_type;
5585+
return state != NULL ? state->sock_type : NULL;
55875586
}
55885587

55895588
PyErr_Format(PyExc_AttributeError, "module _socket has no attribute '%U'", name);

0 commit comments

Comments
 (0)