python3-pynetlinux: fix relative imports

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

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Bartosz Golaszewski
2023-05-31 10:23:26 +02:00
committed by Khem Raj
parent b06204baf3
commit 1a3d3d1364
2 changed files with 64 additions and 1 deletions

View File

@@ -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

View File

@@ -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