]@s{ddlmZddlmZdgZGdddZeddZGdddZdd lm Z m Z d S) )ref)contextmanagerlocalc@s:eZdZd ZddZdd Zd d Zd S) _localimplkeydicts localargs locallock __weakref__cCs&dtt||_i|_dS)Nz_threading_local._localimpl.)stridrr)selfr5/opt/alt/python35/lib64/python3.5/_threading_local.py__init__sz_localimpl.__init__cCst}|jt|dS)N)current_threadrr )r threadrrrget_dicts z_localimpl.get_dictcsi}|j}t}t|}|fdd}|fdd}t||t|||j|<|f|j|<|S)Ncs#}|dk r|j|=dS)N)__dict__)_rr)wrthreadrr local_deleteds  z-_localimpl.create_dict..local_deletedcs+}|dk r'|jj|}dS)N)rpop)ridtrdct)wrlocalrrthread_deleteds  z._localimpl.create_dict..thread_deleted)rrr rrr)r Z localdictrrrrrr)rrr create_dicts    z_localimpl.create_dictN)rrrr r )__name__ __module__ __qualname__ __slots__rrrrrrrrs   rccstj|d}y|j}Wn=tk ra|j}|j\}}|j||YnX|jtj|d|dVWdQRXdS)N _local__implr) object__getattribute__rKeyErrorrrrr __setattr__)r implrargskwrrr_patchs   r+c@sFeZdZd ZddZddZddZd d Zd S) rr#rcOs~|s |r*|jtjkr*tdtj|}t}||f|_t|_tj|d||j |S)Nz*Initialization arguments are not supportedr#) rr$ TypeError__new__rrRLockr 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__c CsM|dkr"td|jjt|tj|||SWdQRXdS)Nrz+%r object attribute '__dict__' is read-only)AttributeError __class__rr+r$r')r r0valuerrrr's   zlocal.__setattr__c CsJ|dkr"td|jjt|tj||SWdQRXdS)Nrz+%r object attribute '__dict__' is read-only)r1r2rr+r$ __delattr__)r r0rrrr4s   zlocal.__delattr__N)r#r)rr r!r"r-r%r'r4rrrrrs    )rr.N) weakrefr contextlibr__all__rr+r threadingrr.rrrrs  ,&