Skip to content

Commit

Permalink
Made exit codes more reliable.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Feb 2, 2018
1 parent fbeef39 commit 12a9a56
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ def help_text():
finally:
if cmake_process.wait() != 0:
print('Errors occurred during CMake.')
exit(1)
call(['make', 'install', '-j1'])
exit(1)
exit_code = call(['make', 'install', '-j1'])
exit(exit_code)
else:
try:
import cython
call(['cmake', '../', '-DENABLE_CYTHON=ON'])
exit_code = call(['cmake', '../', '-DENABLE_CYTHON=ON'])
if exit_code != 0:
exit(exit_code)
except ModuleNotFoundError:
call(['cmake', '../'])
exit_code = call(['cmake', '../'])
if exit_code != 0:
exit(exit_code)
finally:
call(['make', 'install', '-j4'])
exit_code = call(['make', 'install', '-j4'])
exit(exit_code)

0 comments on commit 12a9a56

Please sign in to comment.