File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -5575,15 +5575,14 @@ static PyType_Spec sock_spec = {
55755575};
55765576
55775577static  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 );
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments