Commits

German Larrain  committed f98b3a7

demo_runner.main: added error catching for index out of range

  • Participants
  • Parent commits 2672458

Comments (0)

Files changed (1)

File demo_runner.py

 			print('Error, invalid input')
 			return 1
 
-		selected_demo = DEMOS[selected_demo_index]  # (module, class_name)
+		try:
+			selected_demo = DEMOS[selected_demo_index]  # (module, class_name)
+		except IndexError:
+			print('Error, option number is out of range')
+			return 2
 		module = import_module(DEMOS_PACKAGE_PREFIX + '.' + selected_demo[0])
 		klass = getattr(module, selected_demo[1])