use sys.exit() not exit()

exit() is meant to be a helper in interactive repls and won't work if python is started with -S in a script
https://stackoverflow.com/questions/6501121/difference-between-exit-and-sys-exit-in-python
This commit is contained in:
Tim Snyder 2022-03-15 07:06:47 +00:00
parent 9de9851d5a
commit 24f48d716e
2 changed files with 4 additions and 3 deletions

View File

@ -315,7 +315,7 @@ def check_env() -> None:
# make sure that sourceme-f1 was sourced
if os.environ.get('FIRESIM_SOURCED') is None:
rootLogger.critical("ERROR: You must source firesim/sourceme-f1-manager.sh!")
exit(1)
sys.exit(1)
def main(args):
@ -395,4 +395,4 @@ if __name__ == '__main__':
exitcode = 1
finally:
rootLogger.info("""The full log of this run is:\n{basedir}/{fulllog}""".format(basedir=dname, fulllog=full_log_filename))
exit(exitcode)
sys.exit(exitcode)

View File

@ -18,6 +18,7 @@ from runtools.workload import WorkloadConfig
from runtools.run_farm import RunFarm
from util.streamlogger import StreamLogger
import os
import sys
LOCAL_DRIVERS_BASE = "../sim/output/f1/"
LOCAL_DRIVERS_GENERATED_SRC = "../sim/generated-src/f1/"
@ -209,7 +210,7 @@ class RuntimeHWConfig:
if localcap.failed:
rootLogger.info("FPGA software driver build failed. Exiting. See log for details.")
rootLogger.info("""You can also re-run '{}' in the 'firesim/sim' directory to debug this error.""".format(driverbuildcommand))
exit(1)
sys.exit(1)
self.driver_built = True