Skip to content

Commit

Permalink
change exit(0) to exit(1) (#1264)
Browse files Browse the repository at this point in the history
for amber.
  • Loading branch information
hainm committed Jun 8, 2016
1 parent 90c8bb6 commit 34ff56c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
my_script))
print(
"Note: long testing requires nose and coverage, which are easily installed by `pip install`")
sys.exit(0)
sys.exit(1)

print("start testing. Go to ./tests folder")
os.chdir("./tests/")
Expand All @@ -79,7 +79,7 @@
os.system("python ./run_simple_test.py")
print('\nHAPPY COMPUTING')
print(art)
sys.exit(0)
sys.exit(1)
else:
if with_coverage:
os.system("{bin}/nosetests --with-coverage --cover-package pytraj -vs .".format(bin=bin))
Expand Down
12 changes: 6 additions & 6 deletions scripts/base_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def check_cpptraj_version(header_dir, version=(4, 2, 9)):
int_version = tuple(int(i) for i in line.split()[-1].strip('"').replace('V', '').split('.'))
if int_version < version:
sys.stderr.write('must have cpptraj version >= {}\n'.format(version))
sys.exit(0)
sys.exit(1)


def remind_export_LD_LIBRARY_PATH(build_tag, libdir, pytraj_inside_amber):
Expand Down Expand Up @@ -287,11 +287,11 @@ def try_updating_libcpptraj(cpptraj_home,
except CalledProcessError:
print(
'can not install libcpptraj, you need to install it manually \n')
sys.exit(0)
sys.exit(1)
else:
print('can not find libcpptraj in $CPPTRAJHOME/lib. '
'You need to install ``libcpptraj`` manually. ')
sys.exit(0)
sys.exit(1)


def add_openmp_flag(disable_openmp,
Expand Down Expand Up @@ -339,10 +339,10 @@ def check_cython(ISRELEASED, cmdclass, min_version='0.21'):
cmdclass['build_ext'] = build_ext
if Cython.__version__ < min_version:
print(message_cython)
sys.exit(0)
sys.exit(1)
except ImportError:
print(message_cython)
sys.exit(0)
sys.exit(1)
return need_cython, cmdclass, cythonize


Expand Down Expand Up @@ -391,7 +391,7 @@ def get_include_and_lib_dir(rootname, cpptrajhome, has_cpptraj_in_current_folder
except CalledProcessError:
print(
'can not install libcpptraj, you need to install it manually \n')
sys.exit(0)
sys.exit(1)
cpptraj_dir = os.path.join(rootname, "cpptraj")
cpptraj_include = os.path.join(cpptraj_dir, 'src')
libdir = os.path.join(cpptraj_dir, 'lib')
Expand Down
2 changes: 1 addition & 1 deletion scripts/cythonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if Cython.__version__ < '0.21':
sys.stderr.write('require cython version >=0.21')
sys.exit(0)
sys.exit(1)

DEBUG = False

Expand Down
2 changes: 1 addition & 1 deletion scripts/find_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def find_lib(libname, unique=True):
import sys

if len(sys.argv) == 1:
sys.exit(0)
sys.exit(1)

print(find_lib(sys.argv[1]))
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# python version >= 2.6
if sys.version_info < (2, 6):
print('You must have at least Python 2.6 for pytraj\n')
sys.exit(0)
sys.exit(1)

amber_release = check_flag('--amber_release')
disable_openmp = check_flag('--disable-openmp')
Expand Down Expand Up @@ -164,7 +164,7 @@ def read(fname):
output_openmp_check = subprocess.check_output(['nm', libcpptraj_files[0]]).decode().split('\n')
except IndexError:
print("Warning: It seems that there is no libcpptraj. Please install it")
sys.exit(0)
sys.exit(1)

libcpptraj_has_openmp = ([line for line in output_openmp_check if 'omp_get_num_threads' in line.lower()] != [])
if libcpptraj_has_openmp and sys.platform == 'darwin':
Expand Down

0 comments on commit 34ff56c

Please sign in to comment.