Just saw what they do in numba:

python -c "import sys;import numba;sys.exit(0 if numba.test() else 1)"