Your IP : 13.59.36.4


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/_threading_local.cpython-35.opt-2.pyc



���]��@s{ddlmZddlmZdgZGdd�d�Zedd��ZGdd�d�Zdd	lm	Z	m
Z
d
S)�)�ref)�contextmanager�localc@s:eZdZd
Zdd�Zdd	�Zd
d�ZdS)�
_localimpl�key�dicts�	localargs�	locallock�__weakref__cCs&dtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�5/opt/alt/python35/lib64/python3.5/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)N�)�current_threadrr)r
�threadrrr�get_dict�s	z_localimpl.get_dictcs�i}|j}t�}t|�}|�fdd�}|�fdd�}t||��t||���|j|<�|f|j|<|S)Ncs#��}|dk	r|j|=dS)N)�__dict__)�_rr)�wrthreadrr�
local_deleted�s	z-_localimpl.create_dict.<locals>.local_deletedcs+��}|dk	r'|jj|�}dS)N)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�s	z._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s		
z_localimpl.create_dictN)rrrr	r
)�__name__�
__module__�__qualname__�	__slots__rrrrrrrr�srccs�tj|d�}y|j�}Wn=tk
ra|j�}|j\}}|j||�YnX|j�tj|d|�dVWdQRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s

r+c@sFeZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)
rr#rcOs~|s|r*|jtjkr*td��tj|�}t�}||f|_t�|_tj|d|�|j	�|S)Nz*Initialization arguments are not supportedr#)
rr$�	TypeError�__new__rr�RLockr	r'r)�clsr)r*r
r(rrrr-�s	
z
local.__new__c
Cs(t|��tj||�SWdQRXdS)N)r+r$r%)r
�namerrrr%�s
zlocal.__getattribute__cCsM|dkr"td|jj��t|��tj|||�SWdQRXdS)Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__rr+r$r')r
r0�valuerrrr'�s
zlocal.__setattr__c
CsJ|dkr"td|jj��t|��tj||�SWdQRXdS)Nrz+%r object attribute '__dict__' is read-only)r1r2rr+r$�__delattr__)r
r0rrrr4�s
zlocal.__delattr__N)r#r)rr r!r"r-r%r'r4rrrrr�s
)rr.N)�weakrefr�
contextlibr�__all__rr+r�	threadingrr.rrrr�<module>�s	,&

?>