#NEWLINE# def _bcompile( file , cfile = None , dfile = None , doraise = False ) : #NEWLINE# #INDENT# encoding = py_compile . read_encoding ( file , 'utf-8' ) #NEWLINE# f = open ( file , 'U' , encoding = codestring ) #NEWLINE# try : #NEWLINE# #INDENT# timestamp = int ( os . fstat ( f . fileno ( ) ) . st_mtime ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# timestamp = int ( os . stat ( file ) . st_mtime ) #NEWLINE# #UNINDENT# codestring = f . read ( ) #NEWLINE# f . close ( ) #NEWLINE# if ( codestring and ( codestring [ ( - 1 ) ] != '\n' ) ) : #NEWLINE# #INDENT# codestring = ( codestring + '\n' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# codeobject = builtins . compile ( codestring , ( dfile or file ) , 'exec' ) #NEWLINE# #UNINDENT# except Exception as err : #NEWLINE# #INDENT# py_exc = py_compile . PyCompileError ( err . __class__ , err , ( dfile or file ) ) #NEWLINE# if doraise : #NEWLINE# #INDENT# raise py_exc #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sys . stderr . write ( ( py_exc . msg + '\n' ) ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# fc = io . BytesIO ( ) #NEWLINE# try : #NEWLINE# #INDENT# fc . write ( b'\x00\x00\x00\x00' ) #NEWLINE# py_compile . wr_long ( fc , timestamp ) #NEWLINE# marshal . dump ( codeobject , fc ) #NEWLINE# fc . flush ( ) #NEWLINE# fc . seek ( 0 , 0 ) #NEWLINE# fc . write ( py_compile . MAGIC ) #NEWLINE# return fc . getvalue ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# fc . close ( )