bug 106363 , selinux failed import resulting in module hanging around causing issues...
authorBrian Harring <ferringb@gentoo.org>
Tue, 20 Sep 2005 13:13:10 +0000 (13:13 -0000)
committerBrian Harring <ferringb@gentoo.org>
Tue, 20 Sep 2005 13:13:10 +0000 (13:13 -0000)
import selinux == fail; next attempt, import selinux == non-fail
Python 'feature' of sorts.

svn path=/main/branches/2.0/; revision=2011

ChangeLog
pym/portage.py

index bedbc095c91654c59fa267661b8cdc7d7f65a685..1be33d5a7613eb521f251e1de1d53a246d322d18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
     2. /var/cache/edb/world is now /var/lib/portage/world.
     3. /etc/portage/profile/virtuals is _USER_ configs only.
 
+  20 Sep 2005; Brian Harring <ferringb@gentoo.org> pym/portage.py:
+  Cleanup after python, remove module from sys.modules that was a failed import.
+
   18 Sep 2005; Mike Frysinger <vapier@gentoo.org> bin/etc-update:
   Make sure diff works before checking config files #48184.
 
index d264ef68eaa661c9c83a4a2616a83cebaab0952a..ef9e9b5c7e89018fa3b4595f3b72b3bed882effa 100644 (file)
@@ -7164,6 +7164,11 @@ if 'selinux' in settings["USE"].split(" "):
        except ImportError:
                writemsg(red("!!! SELinux module not found.")+" Please verify that it was installed.\n")
                selinux_enabled=0
+       if selinux_enabled == 0:
+               try:    
+                       del sys.modules["selinux"]
+               except KeyError:
+                       pass
 else:
        selinux_enabled=0