From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8B29E138350 for ; Sun, 2 Feb 2020 09:00:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8BDE1E07F9; Sun, 2 Feb 2020 09:00:23 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 704A5E07F9 for ; Sun, 2 Feb 2020 09:00:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CFB0F34E441 for ; Sun, 2 Feb 2020 09:00:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 51AE817 for ; Sun, 2 Feb 2020 09:00:00 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1580633888.c3627bb8302c563591249597c7a3ab6ab24b68ea.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/_selinux.py X-VCS-Directories: lib/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c3627bb8302c563591249597c7a3ab6ab24b68ea X-VCS-Branch: master Date: Sun, 2 Feb 2020 09:00:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e482d192-633d-430d-b505-c48e7e94486c X-Archives-Hash: 5fefb37d5710be8e7954d3f03d5fb9e8 commit: c3627bb8302c563591249597c7a3ab6ab24b68ea Author: Zac Medico gentoo org> AuthorDate: Sun Feb 2 08:51:50 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Feb 2 08:58:08 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3627bb8 sphinx-build: avoid autodoc ModuleNotFoundError for selinux Signed-off-by: Zac Medico gentoo.org> lib/portage/_selinux.py | 9 ++++++--- 1 file 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')