Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/test_importlib/source/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/test_importlib/source/__pycache__/util.cpython-33.pyc

�
��f�c@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZdd�Zdd�Z
ejd	d
��ZdS(i(uutiliN(usupportcs8tjrdd�Stj���fdd��}|S(utDecorator to protect sys.dont_write_bytecode from mutation and to skip
    tests that require it to be set to False.c_sdS(N(uNone(uargsukwargs((uD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyu<lambda>su'writes_bytecode_files.<locals>.<lambda>cs6tj}dt_z�||�}Wd|t_X|S(NF(usysudont_write_bytecodeuFalse(uargsukwargsuoriginalu	to_return(ufxn(uD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyuwrappers		
u&writes_bytecode_files.<locals>.wrapper(usysudont_write_bytecodeu	functoolsuwraps(ufxnuwrapper((ufxnuD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyuwrites_bytecode_files
s	
!	uwrites_bytecode_filescCsaytjtjj|��Wn=tk
r\}z|jtjkrJ�nWYdd}~XnXdS(u�Ensure that the __pycache__ directory for PEP 3147 pyc file exists.

    :param bytecode_path: File system path to PEP 3147 pyc file.
    N(uosumkdirupathudirnameuOSErroruerrnouEEXIST(u
bytecode_pathuerror((uD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyuensure_bytecode_paths
uensure_bytecode_pathcgsd}g}i}d}d}z�tj�}||d<t�}x<|D]4}|jd�se|}	n|dtd��}	|j|	�|	tjkr�tj|	=n|j	d�}
|}x\|
dd�D]J}t
jj||�}t
jj
|�s�t
j|�|j|�q�q�Wt
jj||
dd�}t|d	��}
|
j|j|��WdQX|j|�|||<qGWtj|�}|j�tjd
|g�}|j�|VWd|dk	r�|jddd�n|dk	r|jddd�ntj|�XdS(
uRTemporarily create each named module with an attribute (named 'attr')
    that contains the name passed into the context manager that caused the
    creation of the module.

    All files are created in a temporary directory returned by
    tempfile.mkdtemp(). This directory is inserted at the beginning of
    sys.path. When the context manager exits all created files (source and
    bytecode) are explicitly deleted.

    No magic is performed when creating packages! This means that if you create
    a module within a package you must also create the package's __init__ as
    well.

    uattr = {0!r}u.rootu__init__Nu	.__init__u.iu.pyuwupathi����i����(uNoneutempfileumkdtempusetuendswithulenuaddusysumodulesusplituosupathujoinuexistsumkdiruappenduopenuwriteuformatuutiluuncacheu	__enter__uimport_stateu__exit__usupporturmtree(unamesusourceu
created_pathsumappingu
state_manageruuncache_managerutemp_diruimport_namesunameuimport_nameu
name_partsu	file_pathu	directoryufile((uD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyucreate_modules*sL
	
	





	ucreate_modules(uuutilu
contextlibuerrnou	functoolsuimpuosuos.pathusysutempfileutestusupportuwrites_bytecode_filesuensure_bytecode_pathucontextmanagerucreate_modules(((uD/opt/alt/python33/lib64/python3.3/test/test_importlib/source/util.pyu<module>s