#NEWLINE# def _get_bzr_version( ) : #NEWLINE# #INDENT# 'Looks up bzr version by calling bzr --version.\n    :raises: VcsError if bzr is not installed' #NEWLINE# try : #NEWLINE# #INDENT# ( value , output , _ ) = run_shell_command ( 'bzr --version' , shell = True , us_env = True ) #NEWLINE# if ( ( value == 0 ) and ( output is not None ) and ( len ( output . splitlines ( ) ) > 0 ) ) : #NEWLINE# #INDENT# version = output . splitlines ( ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise VcsError ( ( 'bzr --version returned %s,' + ( ' maybe bzr is not installed' % value ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except VcsError as e : #NEWLINE# #INDENT# raise VcsError ( ( 'Coud not determine whether bzr is installed: %s' % version ) ) #NEWLINE# #UNINDENT# return version