diff mbox series

[meta-python,078/149] python3-pynetlinux: fix relative imports

Message ID 20230531082437.10646-79-brgl@bgdev.pl
State New
Headers show
Series python3: improve run-time dependencies situation | expand

Commit Message

Bartosz Golaszewski May 31, 2023, 8:23 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Pull in a patch from upstream that addresses an issue with relative
imports.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 .../0002-Fixed-relative-imports.patch         | 60 +++++++++++++++++++
 .../python/python3-pynetlinux_1.1.bb          |  5 +-
 2 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-pynetlinux/0002-Fixed-relative-imports.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pynetlinux/0002-Fixed-relative-imports.patch b/meta-python/recipes-devtools/python/python3-pynetlinux/0002-Fixed-relative-imports.patch
new file mode 100644
index 000000000..9b5d9d636
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pynetlinux/0002-Fixed-relative-imports.patch
@@ -0,0 +1,60 @@ 
+From afb778669efbc658a29e6bdb1c4834fee42931aa Mon Sep 17 00:00:00 2001
+From: Robert Grant <rgrant@mdi.us.com>
+Date: Wed, 10 Sep 2014 14:56:33 -0400
+Subject: [PATCH] Fixed relative imports
+
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+
+---
+Upstream-Status: Accepted
+
+ pynetlinux/__init__.py | 8 ++++----
+ pynetlinux/brctl.py    | 2 +-
+ pynetlinux/tap.py      | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/pynetlinux/__init__.py b/pynetlinux/__init__.py
+index dbbf392..b6e1b8e 100644
+--- a/pynetlinux/__init__.py
++++ b/pynetlinux/__init__.py
+@@ -2,7 +2,7 @@
+ #   import pylinux
+ # does a reasonable thing.
+ 
+-import brctl
+-import ifconfig
+-import tap
+-import route
++from . import brctl
++from . import ifconfig
++from . import tap
++from . import route
+diff --git a/pynetlinux/brctl.py b/pynetlinux/brctl.py
+index f54d176..a8b926e 100644
+--- a/pynetlinux/brctl.py
++++ b/pynetlinux/brctl.py
+@@ -3,7 +3,7 @@ import fcntl
+ import os
+ import struct
+ 
+-import ifconfig
++from . import ifconfig
+ 
+ SYSFS_NET_PATH = "/sys/class/net"
+ 
+diff --git a/pynetlinux/tap.py b/pynetlinux/tap.py
+index 0a0d59c..3f8ad3a 100644
+--- a/pynetlinux/tap.py
++++ b/pynetlinux/tap.py
+@@ -2,7 +2,7 @@ import fcntl
+ import os
+ import struct
+ 
+-import ifconfig
++from . import ifconfig
+ 
+ # From linux/if_tun.h
+ 
+-- 
+2.39.2
+
diff --git a/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb b/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
index a5ac74fd6..c6ab07448 100644
--- a/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
+++ b/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
@@ -7,6 +7,9 @@  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=74e1861736ee959824fe7542323c12e9"
 
 SRC_URI[sha256sum] = "4ad08298c9f5ba15a11cddc639ba8778cabdfc402b51066d9e0a325e5a5b391c"
 
-SRC_URI += "file://0001-setup.py-switch-to-setuptools.patch"
+SRC_URI += " \
+    file://0001-setup.py-switch-to-setuptools.patch \
+    file://0002-Fixed-relative-imports.patch \
+"
 
 inherit pypi setuptools3