1 |
Bug: https://bugs.gentoo.org/718578 |
2 |
Signed-off-by: Mike Gilbert <floppym@g.o> |
3 |
--- |
4 |
lib/portage/process.py | 11 +++++++++-- |
5 |
1 file changed, 9 insertions(+), 2 deletions(-) |
6 |
|
7 |
diff --git a/lib/portage/process.py b/lib/portage/process.py |
8 |
index 590116890..79052b608 100644 |
9 |
--- a/lib/portage/process.py |
10 |
+++ b/lib/portage/process.py |
11 |
@@ -27,6 +27,13 @@ from portage.const import BASH_BINARY, SANDBOX_BINARY, FAKEROOT_BINARY |
12 |
from portage.exception import CommandNotFound |
13 |
from portage.util._ctypes import find_library, LoadLibrary, ctypes |
14 |
|
15 |
+try: |
16 |
+ from portage.util.netlink import RtNetlink |
17 |
+except ImportError: |
18 |
+ if platform.system() == "Linux": |
19 |
+ raise |
20 |
+ RtNetlink = None |
21 |
+ |
22 |
try: |
23 |
import resource |
24 |
max_fd_limit = resource.getrlimit(resource.RLIMIT_NOFILE)[0] |
25 |
@@ -504,8 +511,8 @@ def _configure_loopback_interface(): |
26 |
# Bug: https://bugs.gentoo.org/690758 |
27 |
# Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12377#c13 |
28 |
|
29 |
- # Avoid importing this module on systems that may not support netlink sockets. |
30 |
- from portage.util.netlink import RtNetlink |
31 |
+ if RtNetlink is None: |
32 |
+ return |
33 |
|
34 |
try: |
35 |
with RtNetlink() as rtnl: |
36 |
-- |
37 |
2.26.1 |