Reading online some programmers use sys.exit, others use SystemExit. Sorry for the basic question:
sys.exit
SystemExit
sys.exit(s) is just shorthand for raise SystemExit(s), as described in the former's docstring; try help(sys.exit). So, instead of either one of your example programs, you can do
sys.exit(s)
raise SystemExit(s)
help(sys.exit)
sys.exit('Unable to open %s' % reference)