3
�
�^
c @ s~ d dl Zd dlZd dlZd dlZd dlZd dlZd dlZdddgZG dd� de �Z
ddd�Zd
d d�Ze
d
krzeje� � dS )� N�compile�main�PyCompileErrorc @ s e Zd Zddd�Zdd� ZdS )r � c C st |j }|tkr2djtj||��}|jdd| �}nd||f }tj| |pJ||||� || _|| _ || _
|pl|| _d S )Nr zFile "<string>"z File "%s"z
Sorry: %s: %s)�__name__ZSyntaxErrorZjoin� tracebackZformat_exception_onlyZreplace� Exception�__init__�
exc_type_name� exc_value�file�msg)�selfZexc_typer
r r r ZtbtextZerrmsg� r �"/usr/lib64/python3.6/py_compile.pyr - s
zPyCompileError.__init__c C s | j S �N)r )r
r r r �__str__= s zPyCompileError.__str__N)r )r Z
__module__Z__qualname__r r r r r r r s
F� c C s� |d kr>|dkr2|dkr|nd}t jj| |d�}nt jj| �}tjj|�r^d}t|j|���n,tjj|�r�tjj |� r�d}t|j|���t j
jd| �}|j| �}y|j
||p�| |d�} W nV tk
�r }
z8t|
j|
|p�| �}|r�|�ntjj|jd � d S W Y d d }
~
X nX y tjj|�}|�r0tj|� W n tk
�rH Y nX |j| �}
t jj| |
d
|
d �}t jj| �}t jj|||� |S )Nr r r )�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)Z _optimize�
ZmtimeZsize)� importlibZutilZcache_from_source�osZpathZislinkZFileExistsErrorZformatZexistsZisfileZ machineryZSourceFileLoaderZget_dataZsource_to_coder r Z __class__�sys�stderr�writer �dirnameZmakedirsZ
path_statsZ_bootstrap_externalZ_code_to_bytecodeZ
_calc_modeZ
_write_atomic)r ZcfileZdfile�doraiseZoptimizer r ZloaderZsource_bytesZcodeZerrZpy_excr Zsource_statsZbytecodeZmoder r r r A sF )
c C s" | d krt jdd � } d}| dgkr�x�t jj� }|s6P |jd�}yt|dd� W q& tk
r� } zd}t jjd|j � W Y d d }~X q& t
k
r� } zd}t jjd| � W Y d d }~X q&X q&W nZxX| D ]P}yt|dd� W q� tk
�r } zd}t jjd|j � W Y d d }~X q�X q�W |S )Nr r z-r T)r z%s
)r ZargvZstdinZreadlineZrstripr r r r r ZOSError)ZargsZrvZfilenameZerrorr r r r � s0
"(
(Z__main__�����)NNFr r )Zimportlib._bootstrap_externalr Zimportlib.machineryZimportlib.utilr Zos.pathr r Z__all__r r r r r Zexitr r r r Z<module> s
0
R
&