
    3i                     p    d Z ddlZddlZddlmZmZmZ ddlmZ erddl	m
Z
 defdZdefd	Zd
edefdZy)zDecorators Hub.    N)TYPE_CHECKINGAnyCallable   )RefreshOption)MySQLConnectionAbstractreturnc                  &    dt         dt         fd} | S )z|Decorator verifying which options are relevant and which aren't based on
    the server version the client is connecting to.cmd_refreshr	   c           	      l     t        j                         dddt        dt        dt        f fd       }|S )Ncnxr   argskwargsr	   c                     |d   }|t         j                  z  r+| j                  dk\  rt        j                  dt
        d        | |fi |S )Nr   )	      r   zAs of MySQL Server 9.2.0, refreshing grant tables is not needed if you use statements GRANT, REVOKE, CREATE, DROP, or ALTER. You should expect this option to be unsupported in a future version of MySQL Connector/Python when MySQL Server removes it.r   category
stacklevel)r   GRANTserver_versionwarningswarnDeprecationWarning)r   r   r   optionsr   s       @D:\jyotish\venv\Lib\site-packages\mysql/connector/_decorating.pywrapperz>cmd_refresh_verify_options.<locals>.decorator.<locals>.wrapper/   s_      7G----33E3E J 4
 V 0  sG6v66    	functoolswrapsr   r   )r   r   s   ` r   	decoratorz-cmd_refresh_verify_options.<locals>.decorator.   sE    		%	7*	736	7BE	7	7 
&	7( r   r   r"   s    r   cmd_refresh_verify_optionsr%   *   s    x H 0 r   c                  &    dt         dt         fd} | S )z
    Decorator to close the current connection if a read or a write timeout
    is raised by the method passed via the func parameter.
    
cnx_methodr	   c           	      l     t        j                         dddt        dt        dt        f fd       }|S )Nr   r   r   r   r	   c                     	  | g|i |S # t         $ r'}t        |t              r| j                          |d }~ww xY w)N)	Exception
isinstanceTimeoutErrorclose)r   r   r   errr'   s       r   handle_cnx_methodzGhandle_read_write_timeout.<locals>.decorator.<locals>.handle_cnx_methodP   sE    !#7777 c<0IIK	s    	?":?)r    r!   r   )r'   r/   s   ` r   r"   z,handle_read_write_timeout.<locals>.decoratorO   sF    		$	*	36	BE		 
%	 ! r   r#   r$   s    r   handle_read_write_timeoutr0   I   s    !h !8 ! r   reasonc                 ,     dt         dt         f fd}|S )z&Use it to decorate deprecated methods.funcr	   c                 l     t        j                         dt        dt        dt        f fd       }|S )Nr   r   r	   c                  l    t        j                  dj                   d t        d        | i |S )NzCall to deprecated function z
. Reason: r   r   )r   r   __name__r   )r   r   r3   r1   s     r   r   z.deprecated.<locals>.decorator.<locals>.wrapperd   s;    MM.t}}oZxP+
 (((r   r   )r3   r   r1   s   ` r   r"   zdeprecated.<locals>.decoratorc   s:    			)3 	)# 	)( 	) 
	) r   r#   )r1   r"   s   ` r   
deprecatedr7   `   s    
 
X 
 r   )__doc__r    r   typingr   r   r   	constantsr   	abstractsr   r%   r0   strr7    r   r   <module>r>      sJ   :    / / $2H >8 .s x r   