#NEWLINE# def _git_version( ) : #NEWLINE# #INDENT# curdir = os . getcwd ( ) #NEWLINE# ( filedir , _ ) = op . split ( __file__ ) #NEWLINE# os . chdir ( filedir ) #NEWLINE# try : #NEWLINE# #INDENT# fnull = open ( os . devnull , 'w' ) #NEWLINE# version = ( '-git-' + subprocess . check_output ( [ 'git' , 'describe' , '--abbrev=8' , '--dirty' , '--always' , '--tags' ] , stderr = fnull ) . strip ( ) . decode ( 'ascii' ) ) #NEWLINE# return version #NEWLINE# #UNINDENT# except ( OSError , subprocess . CalledProcessError ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . chdir ( curdir )