Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/
Date: Sun, 02 Feb 2020 09:00:24
Message-Id: 1580633888.c3627bb8302c563591249597c7a3ab6ab24b68ea.zmedico@gentoo
1 commit: c3627bb8302c563591249597c7a3ab6ab24b68ea
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 2 08:51:50 2020 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 2 08:58:08 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3627bb8
7
8 sphinx-build: avoid autodoc ModuleNotFoundError for selinux
9
10 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
11
12 lib/portage/_selinux.py | 9 ++++++---
13 1 file changed, 6 insertions(+), 3 deletions(-)
14
15 diff --git a/lib/portage/_selinux.py b/lib/portage/_selinux.py
16 index 985e96628..49e2e8e58 100644
17 --- a/lib/portage/_selinux.py
18 +++ b/lib/portage/_selinux.py
19 @@ -1,4 +1,4 @@
20 -# Copyright 1999-2014 Gentoo Foundation
21 +# Copyright 1999-2020 Gentoo Authors
22 # Distributed under the terms of the GNU General Public License v2
23
24 # Don't use the unicode-wrapped os and shutil modules here since
25 @@ -8,12 +8,15 @@ import shutil
26 import sys
27 import warnings
28
29 +try:
30 + import selinux
31 +except ImportError:
32 + selinux = None
33 +
34 import portage
35 from portage import _encodings
36 from portage import _native_string, _unicode_decode
37 from portage.localization import _
38 -portage.proxy.lazyimport.lazyimport(globals(),
39 - 'selinux')
40
41 def copyfile(src, dest):
42 src = _native_string(src, encoding=_encodings['fs'], errors='strict')