eaiovnaovbqoebvqoeavibavo B  fA@sdZddlZddlZddlZddlZddlZddlZddlZddl Z ddddgZ Gddde Z Gdddej Zd d Zdd dZdddZedkreedS)zqRoutine to "compile" a .py file to a .pyc file. This module has intimate knowledge of the format of .pyc files. NcompilemainPyCompileErrorPycInvalidationModec@s"eZdZdZdddZddZdS) raException raised when an error occurs while attempting to compile the file. To raise this exception, use raise PyCompileError(exc_type,exc_value,file[,msg]) where exc_type: exception type to be used in error message type name can be accesses as class variable 'exc_type_name' exc_value: exception value to be used in error message can be accesses as class variable 'exc_value' file: name of file being compiled to be used in error message can be accesses as class variable 'file' msg: string message to be written as error message If no value is given, a default exception message will be given, consistent with 'standard' py_compile output. message (or default) can be accesses as class variable 'msg' cCst|j}|tkr2dt||}|dd|}n d||f}t||pJ||||||_||_ ||_ |pl||_ dS)NrzFile ""z File "%s"z Sorry: %s: %s) __name__ SyntaxErrorjoin tracebackformat_exception_onlyreplace Exception__init__ exc_type_name exc_valuefilemsg)selfexc_typerrrrtbtexterrmsgr//opt/alt/python37/lib64/python3.7/py_compile.pyr.s  zPyCompileError.__init__cCs|jS)N)r)rrrr__str__>szPyCompileError.__str__N)r)r __module__ __qualname____doc__rrrrrrrs c@seZdZdZdZdZdS)rN)rrr TIMESTAMP CHECKED_HASHUNCHECKED_HASHrrrrrBscCstjdrtjStjSdS)NSOURCE_DATE_EPOCH)osenvirongetrr!r rrrr_get_default_invalidation_modeHs r'Fc Cs|dkrt}|dkrL|dkr@|dkr*|nd}tjj||d}n tj|}tj|rld}t||n*tj |rtj |sd}t||tj d|}| |} y|j| |p||d } WnVtk r} z6t| j| |p|} |r| ntj| jd dSWdd} ~ XYnXy tj|} | r) _optimize mtimesize)"r' importlibutilcache_from_sourcer$pathislinkFileExistsErrorformatexistsisfile machinerySourceFileLoaderget_datasource_to_coder r __class__sysstderrwriterdirnamemakedirsrr path_stats_bootstrap_external_code_to_timestamp_pyc source_hash_code_to_hash_pycr! _calc_mode _write_atomic)rcfiledfiledoraiseoptimizeinvalidation_moder)rloader source_bytescodeerrpy_excr? source_statsbytecoderDmoderrrrOsV+            c Cs"|dkrtjdd}d}|dgkrxtj}|s6P|d}yt|ddWq&tk r}zd}tjd|j Wdd}~XYq&t k r}zd}tjd|Wdd}~XYq&Xq&WnZxX|D]P}yt|ddWqtk r}zd}tjd|j Wdd}~XYqXqW|S) aCompile several source files. The files named in 'args' (or on the command line, if 'args' is not specified) are compiled and the resulting bytecode is cached in the normal manner. This function does not search a directory structure to locate source files; it only compiles files named explicitly. If '-' is the only parameter in args, the list of files is taken from standard input. Nrr-r+T)rJz%s ) r<argvstdinreadlinerstriprrr=r>rOSError)argsrvfilenameerrorrrrrs0    "( (__main__)NNFr(N)N)renumZimportlib._bootstrap_externalr.importlib.machineryimportlib.utilr$Zos.pathr<r __all__r rEnumrr'rrrexitrrrrs" 0 ] &