From 0527f278cbdd3f412d9d0f95b33ca00abe8c10d8 Mon Sep 17 00:00:00 2001 From: LP Date: Thu, 7 Nov 2019 19:29:16 +0800 Subject: [PATCH] Update create.py to support Python3.x file() -> open() dict_obj_A.keys() + dict_obj_B.keys() -> list(dict_obj_A.keys()) + list(dict_obj_B.keys()) --- Tools/uorb_graph/create.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/uorb_graph/create.py b/Tools/uorb_graph/create.py index 9f8a374aa7..2f50e76224 100755 --- a/Tools/uorb_graph/create.py +++ b/Tools/uorb_graph/create.py @@ -286,8 +286,8 @@ class Graph(object): self._publications.filter_modules(self._module_whitelist) # modules & topics sets - self._modules = set(self._publications.pubsubs.keys() + - self._subscriptions.pubsubs.keys()) + self._modules = set(list(self._publications.pubsubs.keys()) + + list(self._subscriptions.pubsubs.keys())) print('number of modules: '+str(len(self._modules))) self._topics = self._get_topics(use_topic_pubsub_union=use_topic_pubsub_union) print('number of topics: '+str(len(self._topics))) @@ -353,7 +353,7 @@ class Graph(object): def _extract_module_name(self, file_name): """ extract the module name from a CMakeLists.txt file and store in self._current_module if there is any """ - datafile = file(file_name) + datafile = open(file_name) found_module_def = False for line in datafile: if 'px4_add_module' in line: # must contain 'px4_add_module'