AlkantarClanX12

Your IP : 3.142.171.100


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/runpy.cpython-33.pyc

�
��f�(c@sdZddlZddlZddlZddlZddlmZmZm	Z	ddgZ
Gdd�de�ZGdd	�d	e�Z
dddddd
d�Zddddddd
�Zdd�Zdd�Zddd�Zddddd�Zdd�Zdd�Zdddd�Zedkr{eej�dkr]eddej�q{ejd=eejd�ndS( uZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
iN(u	read_codeu
get_loaderuget_importeru
run_moduleurun_pathcBs>|EeZdZdZdd�Zdd�Zdd�ZdS(	u_TempModuleuCTemporarily replace a module in sys.modules with an empty namespacecCs(||_tj|�|_g|_dS(N(umod_nameuimpu
new_moduleumoduleu
_saved_module(uselfumod_name((u*/opt/alt/python33/lib64/python3.3/runpy.pyu__init__s	u_TempModule.__init__cCsM|j}y|jjtj|�Wntk
r8YnX|jtj|<|S(N(umod_nameu
_saved_moduleuappendusysumodulesuKeyErrorumodule(uselfumod_name((u*/opt/alt/python33/lib64/python3.3/runpy.pyu	__enter__s	
u_TempModule.__enter__cGs=|jr#|jdtj|j<n
tj|j=g|_dS(Ni(u
_saved_moduleusysumodulesumod_name(uselfuargs((u*/opt/alt/python33/lib64/python3.3/runpy.pyu__exit__'s	
u_TempModule.__exit__N(u__name__u
__module__u__qualname__u__doc__u__init__u	__enter__u__exit__(u
__locals__((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_TempModules	u_TempModulecBs8|EeZdZdd�Zdd�Zdd�ZdS(u_ModifiedArgv0cCs ||_t�|_|_dS(N(uvalueuobjectu_saved_valueu	_sentinel(uselfuvalue((u*/opt/alt/python33/lib64/python3.3/runpy.pyu__init__/s	u_ModifiedArgv0.__init__cCsE|j|jk	r!td��ntjd|_|jtjd<dS(NuAlready preserving saved valuei(u_saved_valueu	_sentineluRuntimeErrorusysuargvuvalue(uself((u*/opt/alt/python33/lib64/python3.3/runpy.pyu	__enter__3su_ModifiedArgv0.__enter__cGs |j|_|jtjd<dS(Ni(u	_sentineluvalueu_saved_valueusysuargv(uselfuargs((u*/opt/alt/python33/lib64/python3.3/runpy.pyu__exit__9su_ModifiedArgv0.__exit__N(u__name__u
__module__u__qualname__u__init__u	__enter__u__exit__(u
__locals__((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_ModifiedArgv0.su_ModifiedArgv0c
Cs[|dk	r|j|�n|jd|d|ddddd|d|�t||�|S(u)Helper to run code in nominated namespaceu__name__u__file__u
__cached__u__doc__u
__loader__u__package__N(uNoneuupdateuexec(ucodeurun_globalsuinit_globalsumod_nameu	mod_fnameu
mod_loaderupkg_name((u*/opt/alt/python33/lib64/python3.3/runpy.pyu	_run_code=s
u	_run_codecCsZt|��B}t|��-|jj}t|||||||�WdQXWdQX|j�S(u5Helper to run code in new namespace with sys modifiedN(u_TempModuleu_ModifiedArgv0umoduleu__dict__u	_run_codeucopy(ucodeuinit_globalsumod_nameu	mod_fnameu
mod_loaderupkg_nameutemp_moduleumod_globals((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_run_module_codeLs
u_run_module_codecCsIxBdD]:}t||d�}|dk	rtjj||��SqWdS(Nuget_filenameu
_get_filename(uget_filenameu
_get_filename(ugetattruNoneuosupathuabspath(uloaderumod_nameuattrumeth((u*/opt/alt/python33/lib64/python3.3/runpy.pyu
_get_filename]s

u
_get_filenamecCst|�}|dkr+td|��n|j|�r�|dksU|jd�rdtd��ny|d}t|�SWq�tk
r�}ztdd||f��WYdd}~Xq�Xn|j|�}|dkr�td|��nt||�}||||fS(NuNo module named %su__main__u	.__main__u%Cannot use package as __main__ moduleu%s; %r is a package and cannot ube directly executeduNo code object available for %s(u
get_loaderuNoneuImportErroru
is_packageuendswithu_get_module_detailsuget_codeu
_get_filename(umod_nameuloaderu
pkg_main_nameueucodeufilename((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_get_module_detailses"
*u_get_module_detailsc
Cs	yF|s|dkr0t|�\}}}}nt�\}}}}Wnktk
r�}zK|rpt|�}ndtjd}dtj|f}tj|�WYdd}~XnX|jd�d}tj	dj
}	|r�|tjd<nt||	dd|||�S(u�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    u__main__u"can't find '__main__' module in %riu%s: %sNu.(
u_get_module_detailsu_get_main_module_detailsuImportErrorustrusysuargvu
executableuexitu
rpartitionumodulesu__dict__u	_run_codeuNone(
umod_nameu
alter_argvuloaderucodeufnameuexcuinfoumsgupkg_nameumain_globals((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_run_module_as_main|s  u_run_module_as_maincCst|�\}}}}|dkr-|}n|jd�d}|r_t||||||�St|i|||||�SdS(unExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    u.iN(u_get_module_detailsuNoneu
rpartitionu_run_module_codeu	_run_code(umod_nameuinit_globalsurun_nameu	alter_sysuloaderucodeufnameupkg_name((u*/opt/alt/python33/lib64/python3.3/runpy.pyu
run_module�s	
cCs�d}tj|}tj|=zryt|�SWn]tk
r�}z=|t|�krxtd|tjdf�|�n�WYdd}~XnXWd|tj|<XdS(Nu__main__ucan't find %r module in %ri(usysumodulesu_get_module_detailsuImportErrorustrupath(u	main_nameu
saved_mainuexc((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_get_main_module_details�s

u_get_main_module_detailscCs�t|d��}t|�}WdQX|dkrxt|d��4}t|j�|d�}tjj||�}WdQXntjj||�}||fS(Nurbuexec(	uopenu	read_codeuNoneucompileureadu	importlibu	machineryuSourceFileLoaderuSourcelessFileLoader(urun_nameufnameufucodeuloader((u*/opt/alt/python33/lib64/python3.3/runpy.pyu_get_code_from_file�su_get_code_from_filecCs3|dkrd}n|jd�d}t|�}t|td�tjf�r�t||�\}}t||||||�St	j
jd|�zot�\}}}}	t
|��H}
t|��3|
jj}t|||||	||�j�SWdQXWdQXWdyt	j
j|�Wntk
r-YnXXdS(u_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    u
<run_path>u.iN(uNoneu
rpartitionuget_importeru
isinstanceutypeuimpuNullImporteru_get_code_from_fileu_run_module_codeusysupathuinsertu_get_main_module_detailsu_TempModuleu_ModifiedArgv0umoduleu__dict__u	_run_codeucopyuremoveu
ValueError(u	path_nameuinit_globalsurun_nameupkg_nameuimporterucodeu
mod_loaderumod_nameuloaderufnameutemp_moduleumod_globals((u*/opt/alt/python33/lib64/python3.3/runpy.pyurun_path�s(
	

&
u__main__iu!No module specified for executionufileTF(u__doc__uosusysuimportlib.machineryu	importlibuimpupkgutilu	read_codeu
get_loaderuget_importeru__all__uobjectu_TempModuleu_ModifiedArgv0uNoneu	_run_codeu_run_module_codeu
_get_filenameu_get_module_detailsuTrueu_run_module_as_mainuFalseu
run_moduleu_get_main_module_detailsu_get_code_from_fileurun_pathu__name__ulenuargvuprintustderr(((u*/opt/alt/python33/lib64/python3.3/runpy.pyu<module>s6
&
,