From 45f7b0de9efbc717d218954f5b1e037ac86e518f Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Thu, 12 Dec 2019 14:43:40 +0100 Subject: [PATCH] dev-ros/roslaunch: upstream py3 fixes Package-Manager: Portage-2.3.81, Repoman-2.3.20 Signed-off-by: Alexis Ballier --- dev-ros/roslaunch/files/py3-2.patch | 29 ++++++++++++ dev-ros/roslaunch/files/py3.patch | 45 +++++++++++++++++++ ...3-r1.ebuild => roslaunch-1.14.3-r2.ebuild} | 2 +- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 dev-ros/roslaunch/files/py3-2.patch create mode 100644 dev-ros/roslaunch/files/py3.patch rename dev-ros/roslaunch/{roslaunch-1.14.3-r1.ebuild => roslaunch-1.14.3-r2.ebuild} (92%) diff --git a/dev-ros/roslaunch/files/py3-2.patch b/dev-ros/roslaunch/files/py3-2.patch new file mode 100644 index 000000000000..d3ae600e4d7e --- /dev/null +++ b/dev-ros/roslaunch/files/py3-2.patch @@ -0,0 +1,29 @@ +From 1933acfa8107a164ec825d3223d14589fefd1b5b Mon Sep 17 00:00:00 2001 +From: Dirk Thomas +Date: Tue, 6 Aug 2019 16:06:51 -0700 +Subject: [PATCH] more Python 3 compatibility (#1783) + +--- + test/test_rospy/test/unit/test_genmsg_py.py | 6 +-- + tools/rosgraph/src/rosgraph/roslogging.py | 2 +- + .../test/test_roslogging_user_logger.py | 8 +++- + tools/roslaunch/test/unit/test_xmlloader.py | 2 +- + tools/rosmsg/src/rosmsg/__init__.py | 2 +- + tools/rosmsg/test/test_rosmsg_command_line.py | 46 +++++++++---------- + .../test/test_rosmsgproto_command_line.py | 20 ++++---- + .../test_rostopic_command_line_offline.py | 44 +++++++++--------- + 8 files changed, 67 insertions(+), 63 deletions(-) + +diff --git a/tools/roslaunch/test/unit/test_xmlloader.py b/tools/roslaunch/test/unit/test_xmlloader.py +index ac30189d0..f582ec230 100644 +--- a/tools/roslaunch/test/unit/test_xmlloader.py ++++ b/tools/roslaunch/test/unit/test_xmlloader.py +@@ -218,7 +218,7 @@ def test_params(self): + p = [p for p in mock.params if p.key == '/configfile'][0] + self.assertEquals(contents, p.value, 1) + p = [p for p in mock.params if p.key == '/binaryfile'][0] +- self.assertEquals(Binary(contents), p.value, 1) ++ self.assertEquals(Binary(contents.encode()), p.value, 1) + + f = open(os.path.join(get_example_path(), 'example.launch')) + try: diff --git a/dev-ros/roslaunch/files/py3.patch b/dev-ros/roslaunch/files/py3.patch new file mode 100644 index 000000000000..8fa2c6e2fab2 --- /dev/null +++ b/dev-ros/roslaunch/files/py3.patch @@ -0,0 +1,45 @@ +From 8f22c20e418abe4abe23e789eef517a16a50604d Mon Sep 17 00:00:00 2001 +From: Dirk Thomas +Date: Tue, 6 Aug 2019 12:50:24 -0700 +Subject: [PATCH] more Python 3 compatibility (#1782) + +--- + test/test_rosmaster/test/nodes/testAllCommonFlows | 2 +- + test/test_rosmaster/test/nodes/testMaster | 2 +- + test/test_rosmaster/test/nodes/testSlave | 2 +- + test/test_rospy/test/unit/test_genmsg_py.py | 8 +++++++- + tools/rosgraph/test/test_roslogging.py | 5 ++++- + tools/rosgraph/test/test_roslogging_user_logger.py | 5 ++++- + tools/roslaunch/src/roslaunch/depends.py | 8 ++++---- + 7 files changed, 22 insertions(+), 10 deletions(-) + +diff --git a/tools/roslaunch/src/roslaunch/depends.py b/tools/roslaunch/src/roslaunch/depends.py +index a3fbf7a41..91ae26998 100644 +--- a/tools/roslaunch/src/roslaunch/depends.py ++++ b/tools/roslaunch/src/roslaunch/depends.py +@@ -86,21 +86,21 @@ def __str__(self): + + def _get_arg_value(tag, context): + name = tag.attributes['name'].value +- if tag.attributes.has_key('value'): ++ if 'value' in tag.attributes.keys(): + return resolve_args(tag.attributes['value'].value, context) + elif name in context['arg']: + return context['arg'][name] +- elif tag.attributes.has_key('default'): ++ elif 'default' in tag.attributes.keys(): + return resolve_args(tag.attributes['default'].value, context) + else: + raise RoslaunchDepsException("No value for arg [%s]"%(name)) + + def _check_ifunless(tag, context): +- if tag.attributes.has_key('if'): ++ if 'if' in tag.attributes.keys(): + val = resolve_args(tag.attributes['if'].value, context) + if not convert_value(val, 'bool'): + return False +- elif tag.attributes.has_key('unless'): ++ elif 'unless' in tag.attributes.keys(): + val = resolve_args(tag.attributes['unless'].value, context) + if convert_value(val, 'bool'): + return False diff --git a/dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild b/dev-ros/roslaunch/roslaunch-1.14.3-r2.ebuild similarity index 92% rename from dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild rename to dev-ros/roslaunch/roslaunch-1.14.3-r2.ebuild index cc74b7791b52..6f8d65622b86 100644 --- a/dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild +++ b/dev-ros/roslaunch/roslaunch-1.14.3-r2.ebuild @@ -31,7 +31,7 @@ DEPEND="${RDEPEND} dev-python/nose[${PYTHON_USEDEP}] dev-ros/test_rosmaster )" -PATCHES=( "${FILESDIR}/timeout.patch" "${FILESDIR}/yaml.patch" ) +PATCHES=( "${FILESDIR}/timeout.patch" "${FILESDIR}/yaml.patch" "${FILESDIR}/py3.patch" "${FILESDIR}/py3-2.patch" ) src_test() { rosdep update -- 2.26.2