From 5c6b68d7cb847e93d43b7afe1b7d3590215c6fbb Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 28 May 2018 13:55:20 +0300 Subject: [PATCH] - forgot to make the changes to sorted_tools in generate_milling method from FlatCAMObj.py --- FlatCAMObj.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 2464e955..1d6e7754 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -847,7 +847,14 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): tooldia = self.options["tooldia"] # Sort tools by diameter. items() -> [('name', diameter), ...] - sorted_tools = sorted(list(self.tools.items()), key=lambda tl: tl[1]) + # sorted_tools = sorted(list(self.tools.items()), key=lambda tl: tl[1]) + + # Python3 no longer allows direct comparison between dicts so we need to sort tools differently + sort = [] + for k, v in self.tools.items(): + sort.append((k, v.get('C'))) + sorted_tools = sorted(sort, key=lambda t1: t1[1]) + log.debug("Tools are sorted: %s" % str(sorted_tools)) if tools == "all": tools = [i[0] for i in sorted_tools] # List if ordered tool names.