Auto merge of #2405 - micbou:called-process-error, r=Valloric
[READY] Catch CalledProcessError exception in install script See PR https://github.com/Valloric/ycmd/pull/630. Closes https://github.com/Valloric/YouCompleteMe/pull/2351. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2405) <!-- Reviewable:end -->
This commit is contained in:
commit
03835a9afc
15
install.py
15
install.py
@ -22,15 +22,22 @@ DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
|
|||||||
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
|
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
|
||||||
|
|
||||||
|
|
||||||
|
def CheckCall( args, **kwargs ):
|
||||||
|
try:
|
||||||
|
subprocess.check_call( args, **kwargs )
|
||||||
|
except subprocess.CalledProcessError as error:
|
||||||
|
sys.exit( error.returncode )
|
||||||
|
|
||||||
|
|
||||||
def Main():
|
def Main():
|
||||||
build_file = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' )
|
build_file = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' )
|
||||||
|
|
||||||
if not p.isfile( build_file ):
|
if not p.isfile( build_file ):
|
||||||
sys.exit( 'File ' + build_file + ' does not exist; you probably forgot '
|
sys.exit(
|
||||||
'to run:\n\tgit submodule update --init --recursive\n\n' )
|
'File {0} does not exist; you probably forgot to run:\n'
|
||||||
|
'\tgit submodule update --init --recursive\n'.format( build_file ) )
|
||||||
|
|
||||||
python_binary = sys.executable
|
CheckCall( [ sys.executable, build_file ] + sys.argv[ 1: ] )
|
||||||
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
|
|
||||||
|
|
||||||
# Remove old YCM libs if present so that YCM can start.
|
# Remove old YCM libs if present so that YCM can start.
|
||||||
old_libs = (
|
old_libs = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user