Bug: https://bugs.gentoo.org/718578
Signed-off-by: Mike Gilbert <flop...@gentoo.org>
---
 lib/portage/process.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/portage/process.py b/lib/portage/process.py
index 590116890..79052b608 100644
--- a/lib/portage/process.py
+++ b/lib/portage/process.py
@@ -27,6 +27,13 @@ from portage.const import BASH_BINARY, SANDBOX_BINARY, 
FAKEROOT_BINARY
 from portage.exception import CommandNotFound
 from portage.util._ctypes import find_library, LoadLibrary, ctypes
 
+try:
+       from portage.util.netlink import RtNetlink
+except ImportError:
+       if platform.system() == "Linux":
+               raise
+       RtNetlink = None
+
 try:
        import resource
        max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
@@ -504,8 +511,8 @@ def _configure_loopback_interface():
        # Bug: https://bugs.gentoo.org/690758
        # Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12377#c13
 
-       # Avoid importing this module on systems that may not support netlink 
sockets.
-       from portage.util.netlink import RtNetlink
+       if RtNetlink is None:
+               return
 
        try:
                with RtNetlink() as rtnl:
-- 
2.26.1


Reply via email to