summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-14 06:57:13 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-14 06:57:13 +0000
commit762248367c097290cc3a6998bbad40f797f9e9c4 (patch)
tree0a6fc19dc859d214d7730e44aa4abaa9dc2e679e
parente0d28a7606a94d38b34ef0599e1f5519cfe3ed1f (diff)
downloadportage-762248367c097290cc3a6998bbad40f797f9e9c4.tar.gz
portage-762248367c097290cc3a6998bbad40f797f9e9c4.tar.bz2
portage-762248367c097290cc3a6998bbad40f797f9e9c4.zip
Make sure portage.selinux and _selinux exist, even when import fails, so
that 'from portage import selinux' never fails inside vartree.py. svn path=/main/trunk/; revision=14025
-rw-r--r--pym/portage/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 76bfcbc44..6cff57d8f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -214,7 +214,8 @@ import shutil as _shutil
shutil = _unicode_module_wrapper(_shutil)
# Imports below this point rely on the above unicode wrapper definitions.
-
+_selinux = None
+selinux = None
try:
import portage._selinux
selinux = _unicode_module_wrapper(_selinux)
@@ -3670,7 +3671,7 @@ class config(object):
if getattr(self, "_selinux_enabled", None) is None:
self._selinux_enabled = 0
if "selinux" in self["USE"].split():
- if "selinux" in globals():
+ if selinux:
if selinux.is_selinux_enabled() == 1:
self._selinux_enabled = 1
else: