[oe] [meta-python][PATCH] python3-pyconnman: fix import issues with python3

Nicola Lunghi nick83ola at gmail.com
Wed Oct 23 08:14:42 UTC 2019


release 0.1.0 of pyconnman is not using relative import so it
crashes when you try to load it with python3.
Add patch from upstream to make it work.

Signed-off-by: Nicola Lunghi <nick83ola at gmail.com>
---
 ...ules-by-relative-path-for-python3-su.patch | 74 +++++++++++++++++++
 .../python3-pyconnman_0.1.0.bb                |  4 +
 2 files changed, 78 insertions(+)
 create mode 100644 meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman/0001-Import-local-modules-by-relative-path-for-python3-su.patch

diff --git a/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman/0001-Import-local-modules-by-relative-path-for-python3-su.patch b/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman/0001-Import-local-modules-by-relative-path-for-python3-su.patch
new file mode 100644
index 000000000..977b4aacd
--- /dev/null
+++ b/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman/0001-Import-local-modules-by-relative-path-for-python3-su.patch
@@ -0,0 +1,74 @@
+From 2e84adb042bfb742eb328220b97f79ddb28db44b Mon Sep 17 00:00:00 2001
+From: Haris Okanovic <haris.okanovic at ni.com>
+Date: Tue, 23 Oct 2018 21:39:56 +0000
+Subject: [PATCH] Import local modules by relative path for python3 support
+
+Upstream-Status: Submitted
+---
+ pyconnman/agent.py      | 2 +-
+ pyconnman/interface.py  | 2 +-
+ pyconnman/manager.py    | 2 +-
+ pyconnman/service.py    | 2 +-
+ pyconnman/technology.py | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/pyconnman/agent.py b/pyconnman/agent.py
+index f72de8d..453d783 100644
+--- a/pyconnman/agent.py
++++ b/pyconnman/agent.py
+@@ -1,5 +1,5 @@
+ from __future__ import unicode_literals
+-from exceptions import ConnCanceledException
++from .exceptions import ConnCanceledException
+ 
+ import dbus.service
+ 
+diff --git a/pyconnman/interface.py b/pyconnman/interface.py
+index 7d82e04..d540c81 100644
+--- a/pyconnman/interface.py
++++ b/pyconnman/interface.py
+@@ -4,7 +4,7 @@ import dbus
+ import types
+ import pprint
+ 
+-from exceptions import ConnSignalNameNotRecognisedException
++from .exceptions import ConnSignalNameNotRecognisedException
+ 
+ 
+ def translate_to_dbus_type(typeof, value):
+diff --git a/pyconnman/manager.py b/pyconnman/manager.py
+index f6f40a8..03244cc 100644
+--- a/pyconnman/manager.py
++++ b/pyconnman/manager.py
+@@ -1,6 +1,6 @@
+ from __future__ import unicode_literals
+ 
+-from interface import ConnInterface
++from .interface import ConnInterface
+ 
+ 
+ class ConnManager(ConnInterface):
+diff --git a/pyconnman/service.py b/pyconnman/service.py
+index bbccced..c6b9241 100644
+--- a/pyconnman/service.py
++++ b/pyconnman/service.py
+@@ -1,6 +1,6 @@
+ from __future__ import unicode_literals
+ 
+-from interface import ConnInterface
++from .interface import ConnInterface
+ 
+ 
+ class ConnService(ConnInterface):
+diff --git a/pyconnman/technology.py b/pyconnman/technology.py
+index 4777229..d25bad6 100644
+--- a/pyconnman/technology.py
++++ b/pyconnman/technology.py
+@@ -1,6 +1,6 @@
+ from __future__ import unicode_literals
+ 
+-from interface import ConnInterface
++from .interface import ConnInterface
+ 
+ 
+ class ConnTechnology(ConnInterface):
diff --git a/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman_0.1.0.bb b/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman_0.1.0.bb
index e0f3fdd75..32bbe8b80 100644
--- a/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman_0.1.0.bb
+++ b/meta-python/recipes-connectivity/python-pyconnman/python3-pyconnman_0.1.0.bb
@@ -2,4 +2,8 @@ require python-pyconnman.inc
 
 inherit setuptools3
 
+SRC_URI_append = " \
+    file://0001-Import-local-modules-by-relative-path-for-python3-su.patch \
+"
+
 RDEPENDS_${PN} += "python3-dbus python3-pprint"
-- 
2.20.1



More information about the Openembedded-devel mailing list