Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all sys.exit(1) from within the code #27

Closed
NOhs opened this issue Apr 15, 2018 · 2 comments
Closed

Remove all sys.exit(1) from within the code #27

NOhs opened this issue Apr 15, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@NOhs
Copy link
Collaborator

NOhs commented Apr 15, 2018

Pulling the plug just because something unexpected happend is not a calm response and makes error tracking/debugging tough. It also makes it impossible to include that code in anything else knowing that it could just exit. We should replace the occurrences of sys.exit(...) with proper exceptions which we should deal with in the main function.

@NOhs NOhs added the enhancement New feature or request label Apr 15, 2018
@GPMueller
Copy link
Contributor

Since d0a3090, only two instances remain:

def _find_clang(logger):
clangpp = _which('clang++')
clang_ar = _which('llvm-ar')
if clangpp:
llvm_root = _Path(clangpp).parents[0]
else:
logger.error('Couldn\'t find clang++ executable')
sys.exit(1)
if not clang_ar:
logger.error('Couldn\'t find llvm-ar executable')
sys.exit(1)
logger.info(f'llvm root directory: {llvm_root}')
logger.info(f'clang++ executable: {clangpp}')
logger.info(f'llvm-ar executable: {clang_ar}')
logger.info(f'Newest supported C++ dialect: {_get_max_supported_compiler_dialect(clangpp)}')
return clangpp, clang_ar

@GPMueller
Copy link
Contributor

This was finished by the merge of PR #53 (e0cd95e).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants