Files
python-getmac/support-python3.9.patch
Dirk Mueller 10a1047105 Accepting request 886090 from home:alarrosa:branches:devel:languages:python
- Add patch to fix build by skipping a test that doesn't work as
  expected:
  * fix-failing-darwin-test.patch
- Add patch to fix build with python 3.9:
  * support-python3.9.patch

OBS-URL: https://build.opensuse.org/request/show/886090
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-getmac?expand=0&rev=12
2021-04-17 08:37:51 +00:00

31 lines
1.0 KiB
Diff

From: Antonio Larrosa <alarrosa@suse.com>
Index: getmac-0.8.2/getmac/getmac.py
===================================================================
--- getmac-0.8.2.orig/getmac/getmac.py
+++ getmac-0.8.2/getmac/getmac.py
@@ -356,6 +356,10 @@ def _uuid_ip(ip):
def _uuid_lanscan_iface(iface):
# type: (str) -> Optional[str]
+ if sys.version_info >= (3,9):
+ # Python 3.9 removed uuid._find_mac
+ return None
+
from uuid import _find_mac # type: ignore
if not PY2:
Index: getmac-0.8.2/tests/test_getmac.py
===================================================================
--- getmac-0.8.2.orig/tests/test_getmac.py
+++ getmac-0.8.2/tests/test_getmac.py
@@ -78,6 +78,8 @@ def test_uuid_ip(mocker):
assert getmac._uuid_ip("en0") is None
+@pytest.mark.skipif(sys.version_info >= (3, 9),
+ reason="uuid._find_mac was removed in Python 3.9")
def test_uuid_lanscan_iface(mocker):
mocker.patch("uuid._find_mac", return_value=2482700837424)
assert getmac._uuid_lanscan_iface("en1") == "02:42:0C:80:62:30"