diff options
author | Zac Medico <zmedico@gentoo.org> | 2020-02-02 00:51:50 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-02-02 00:58:08 -0800 |
commit | c3627bb8302c563591249597c7a3ab6ab24b68ea (patch) | |
tree | 1b91f8c573dea4e706db31c75339a89062a87ae7 | |
parent | Updates for portage-2.3.87 release (diff) | |
download | portage-c3627bb8.tar.gz portage-c3627bb8.tar.bz2 portage-c3627bb8.zip |
sphinx-build: avoid autodoc ModuleNotFoundError for selinux
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/portage/_selinux.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/portage/_selinux.py b/lib/portage/_selinux.py index 985e96628..49e2e8e58 100644 --- a/lib/portage/_selinux.py +++ b/lib/portage/_selinux.py @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Don't use the unicode-wrapped os and shutil modules here since @@ -8,12 +8,15 @@ import shutil import sys import warnings +try: + import selinux +except ImportError: + selinux = None + import portage from portage import _encodings from portage import _native_string, _unicode_decode from portage.localization import _ -portage.proxy.lazyimport.lazyimport(globals(), - 'selinux') def copyfile(src, dest): src = _native_string(src, encoding=_encodings['fs'], errors='strict') |