I realised there needs maybe some clarity about this traceback.
run_function_tests()
this has code to run a short test with my old code.
def run_engine_test(change_list):
for x in change_list:
convert_colour(x[0], region_list.regions_d[x[0]][1], x[1])
change_list = [(n,random.choice(colour_list.colour_list)) for n in region_list.regions_d]
We also have a function called colour detect which will check for patterns in the colour
def colour_detect():
#Detect if colours in the image match the colours on the palette and re-maps the dictionary if a region colour is changed
detected_colours = []
for x in region_list.regions_d:
region_colour = print_img_data(region_list.regions_d[x][0])
region_list.regions_d[x] = [region_list.regions_d[x][0], region_colour]
if region_colour not in detected_colours:
detected_colours.append(region_colour)
This is intended to be run at the beginnig of a "game or round" and then in between the engine ticks when actions like wars are comitted. Hence why it checks all of the images to ensure that the dictionary has been updated correctly.
After that the traceback comes from your functions.