commit:     fc1fb03a18c0521fed33e9aa8a0a39c8fe5867d9
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 12 13:57:15 2019 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 12 14:46:59 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc1fb03a

dev-ros/test_rospy: upstream py3 fixes

Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/test_rospy/files/py3-2.patch               | 40 ++++++++++++++++++++++
 dev-ros/test_rospy/files/py3.patch                 | 34 ++++++++++++++++++
 ...y-1.14.3.ebuild => test_rospy-1.14.3-r1.ebuild} |  3 +-
 3 files changed, 76 insertions(+), 1 deletion(-)

diff --git a/dev-ros/test_rospy/files/py3-2.patch 
b/dev-ros/test_rospy/files/py3-2.patch
new file mode 100644
index 00000000000..18ac23d1686
--- /dev/null
+++ b/dev-ros/test_rospy/files/py3-2.patch
@@ -0,0 +1,40 @@
+From 1933acfa8107a164ec825d3223d14589fefd1b5b Mon Sep 17 00:00:00 2001
+From: Dirk Thomas <[email protected]>
+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/test/test_rospy/test/unit/test_genmsg_py.py 
b/test/test_rospy/test/unit/test_genmsg_py.py
+index 397b35cee..38be1648e 100644
+--- a/test/test_rospy/test/unit/test_genmsg_py.py
++++ b/test/test_rospy/test/unit/test_genmsg_py.py
+@@ -95,8 +95,8 @@ def test_test_rospy_TestFixedArray(self):
+         self.assertEquals([0., 0., 0.], m.f64_3)        
+         self.assertEquals([0], m.i8_1)
+         self.assertEquals([0, 0, 0], m.i8_3)        
+-        self.assertEquals(chr(0), m.u8_1)
+-        self.assertEquals(chr(0)*3, m.u8_3)        
++        self.assertEquals(chr(0).encode(), m.u8_1)
++        self.assertEquals((chr(0)*3).encode(), m.u8_3)
+         self.assertEquals([0], m.i32_1)
+         self.assertEquals([0, 0, 0], m.i32_3)        
+         self.assertEquals([0], m.u32_1)
+@@ -358,7 +358,7 @@ def test_std_msgs_MultiArray(self):
+         # test. the buff was with the uint8[] type consistency
+         buff = StringIO()
+         self.assertEquals(UInt8MultiArray(),UInt8MultiArray())
+-        self.assertEquals('',UInt8MultiArray().data)        
++        self.assertEquals(b'', UInt8MultiArray().data)
+         UInt8MultiArray().serialize(buff)
+         
self.assertEquals(UInt8MultiArray(layout=MultiArrayLayout()),UInt8MultiArray())
+         UInt8MultiArray(layout=MultiArrayLayout()).serialize(buff)

diff --git a/dev-ros/test_rospy/files/py3.patch 
b/dev-ros/test_rospy/files/py3.patch
new file mode 100644
index 00000000000..d7ed0f9c960
--- /dev/null
+++ b/dev-ros/test_rospy/files/py3.patch
@@ -0,0 +1,34 @@
+From 8f22c20e418abe4abe23e789eef517a16a50604d Mon Sep 17 00:00:00 2001
+From: Dirk Thomas <[email protected]>
+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/test/test_rospy/test/unit/test_genmsg_py.py 
b/test/test_rospy/test/unit/test_genmsg_py.py
+index aebf95b22..397b35cee 100644
+--- a/test/test_rospy/test/unit/test_genmsg_py.py
++++ b/test/test_rospy/test/unit/test_genmsg_py.py
+@@ -44,7 +44,13 @@
+ import math
+ 
+ from roslib.message import SerializationError
+-        
++
++try:
++    long
++except NameError:
++    long = int
++
++
+ class TestGenmsgPy(unittest.TestCase):
+ 
+     def test_PythonKeyword(self):

diff --git a/dev-ros/test_rospy/test_rospy-1.14.3.ebuild 
b/dev-ros/test_rospy/test_rospy-1.14.3-r1.ebuild
similarity index 89%
rename from dev-ros/test_rospy/test_rospy-1.14.3.ebuild
rename to dev-ros/test_rospy/test_rospy-1.14.3-r1.ebuild
index c681d244b91..2cf6f271755 100644
--- a/dev-ros/test_rospy/test_rospy-1.14.3.ebuild
+++ b/dev-ros/test_rospy/test_rospy-1.14.3-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -31,3 +31,4 @@ DEPEND="${RDEPEND}
                dev-ros/rospy[${PYTHON_USEDEP}]
                dev-python/nose[${PYTHON_USEDEP}]
        )"
+PATCHES=( "${FILESDIR}/py3.patch" "${FILESDIR}/py3-2.patch" )

Reply via email to