Use sys.exit instead of exit

The global exit function is designed only for the interpreter, so use
the correct one.

Also fix the plandomizer so it does not immediately error when run.
This commit is contained in:
Kevin Cathcart
2017-11-19 16:00:26 -05:00
parent 8158f5793d
commit d4052ab60a
2 changed files with 12 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ import os
import logging
import random
import textwrap
import sys
from Main import main
from Gui import guiMain
@@ -191,11 +192,11 @@ if __name__ == '__main__':
# ToDo: Validate files further than mere existance
if not args.jsonout and not os.path.isfile(args.rom):
input('Could not find valid base rom for patching at expected path %s. Please run with -h to see help for further information. \nPress Enter to exit.' % args.rom)
exit(1)
sys.exit(1)
if args.sprite is not None and not os.path.isfile(args.sprite):
if not args.jsonout:
input('Could not find link sprite sheet at given location. \nPress Enter to exit.' % args.sprite)
exit(1)
sys.exit(1)
else:
raise IOError('Cannot find sprite file at %s' % args.sprite)