From 17ff05d96912a2538595fa679ba934fcb1609162 Mon Sep 17 00:00:00 2001 From: RyanDMott <41179511+RyanDMott@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:55:36 -0400 Subject: [PATCH 1/2] Update topic_tools relay_field to Python 3 Implementing "unicode" to "bytes" fix described in https://github.com/ros/ros_comm/issues/2167. --- tools/topic_tools/scripts/relay_field | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topic_tools/scripts/relay_field b/tools/topic_tools/scripts/relay_field index 6ba4971302..dcbacb02da 100755 --- a/tools/topic_tools/scripts/relay_field +++ b/tools/topic_tools/scripts/relay_field @@ -38,7 +38,7 @@ def _eval_in_dict_impl(dict_, globals_, locals_): type_ = type(v) if type_ is dict: res[k] = _eval_in_dict_impl(v, globals_, locals_) - elif (type_ is str) or (type_ is unicode): + elif (type_ is str) or (type_ is bytes): try: res[k] = eval(v, globals_, locals_) except NameError: From b1a6ad358bb7160ea1338fbae05fcf8a99925882 Mon Sep 17 00:00:00 2001 From: RyanDMott <41179511+RyanDMott@users.noreply.github.com> Date: Mon, 27 Jun 2022 18:47:19 -0400 Subject: [PATCH 2/2] Remove outdated future import --- tools/topic_tools/scripts/relay_field | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/topic_tools/scripts/relay_field b/tools/topic_tools/scripts/relay_field index dcbacb02da..1b767f8a26 100755 --- a/tools/topic_tools/scripts/relay_field +++ b/tools/topic_tools/scripts/relay_field @@ -16,7 +16,6 @@ Example: frame_id: m.data" """ -from __future__ import print_function import argparse import sys import copy