Respect that playerInput can be none
This commit is contained in:
parent
7a8a7ab16a
commit
ea8254c68e
23
seopardy.py
23
seopardy.py
|
@ -73,19 +73,20 @@ if __name__ == '__main__':
|
||||||
# create and start input threads
|
# create and start input threads
|
||||||
print(config["playerInput"])
|
print(config["playerInput"])
|
||||||
inputs = []
|
inputs = []
|
||||||
for playerInput in config["playerInput"]:
|
if config["playerInput"] is not None:
|
||||||
args = playerInput.get("Args", [])
|
for playerInput in config["playerInput"]:
|
||||||
if args is None:
|
args = playerInput.get("Args", [])
|
||||||
args = []
|
if args is None:
|
||||||
|
args = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
inp = get_input(playerInput["Type"], args, app)
|
inp = get_input(playerInput["Type"], args, app)
|
||||||
inputs.append(inp)
|
inputs.append(inp)
|
||||||
except InputException as e:
|
except InputException as e:
|
||||||
print("Error: %s" % e, file=sys.stderr)
|
print("Error: %s" % e, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
inputs[-1].start()
|
inputs[-1].start()
|
||||||
|
|
||||||
# create board
|
# create board
|
||||||
board = SeopardyGame(questions, gamestate)
|
board = SeopardyGame(questions, gamestate)
|
||||||
|
|
Loading…
Reference in New Issue