add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
3

�
�^
c@s~ddlZddlZddlZddlZddlZddlZddlZdddgZGdd�de	�Z
ddd�Zd
d	d�Ze
d
krzeje��dS)�N�compile�main�PyCompileErrorc@seZdZddd�Zdd�ZdS)r�cCst|j}|tkr2djtj||��}|jdd|�}nd||f}tj||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__ZSyntaxErrorZjoin�	tracebackZformat_exception_onlyZreplace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�selfZexc_typer
rrr	ZtbtextZerrmsg�r�"/usr/lib64/python3.6/py_compile.pyr-s
zPyCompileError.__init__cCs|jS�N)r)r
rrr�__str__=szPyCompileError.__str__N)r)rZ
__module__Z__qualname__rrrrrrrs
F�cCs�|dkr>|dkr2|dkr|nd}tjj||d�}ntjj|�}tjj|�r^d}t|j|���n,tjj|�r�tjj	|�r�d}t|j|���tj
jd|�}|j|�}y|j
||p�||d�}	WnVtk
�r}
z8t|
j|
|p�|�}|r�|�ntjj|jd	�dSWYdd}
~
XnXy tjj|�}|�r0tj|�Wntk
�rHYnX|j|�}
tjj|	|
d
|
d�}tjj|�}tjj|||�|S)Nrrr)�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_coderrZ	__class__�sys�stderr�writer�dirnameZmakedirsZ
path_statsZ_bootstrap_externalZ_code_to_bytecodeZ
_calc_modeZ
_write_atomic)rZcfileZdfile�doraiseZoptimizerrZloaderZsource_bytesZcodeZerrZpy_excrZsource_statsZbytecodeZmoderrrrAsF)


cCs"|dkrtjdd�}d}|dgkr�x�tjj�}|s6P|jd�}yt|dd�Wq&tk
r�}zd}tjjd|j	�WYdd}~Xq&t
k
r�}zd}tjjd|�WYdd}~Xq&Xq&WnZxX|D]P}yt|dd�Wq�tk
�r}zd}tjjd|j	�WYdd}~Xq�Xq�W|S)Nrrz-rT)rz%s
)rZargvZstdinZreadlineZrstriprrrrrZOSError)ZargsZrvZfilenameZerrorrrrr�s0


"(
(Z__main__�����)NNFrr)Zimportlib._bootstrap_externalrZimportlib.machineryZimportlib.utilrZos.pathrrZ__all__rrrrrZexitrrrrZ<module>s
0
R
&