From: Brian Harring Date: Tue, 20 Sep 2005 13:13:10 +0000 (-0000) Subject: bug 106363 , selinux failed import resulting in module hanging around causing issues... X-Git-Tag: v2.0.53_rc4_2111~67 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=52b6e16768a132f2248adf1ff6e2dacf77f01769;p=portage.git bug 106363 , selinux failed import resulting in module hanging around causing issues for the logic on the next re-import import selinux == fail; next attempt, import selinux == non-fail Python 'feature' of sorts. svn path=/main/branches/2.0/; revision=2011 --- diff --git a/ChangeLog b/ChangeLog index bedbc095c..1be33d5a7 100644 --- 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 pym/portage.py: + Cleanup after python, remove module from sys.modules that was a failed import. + 18 Sep 2005; Mike Frysinger bin/etc-update: Make sure diff works before checking config files #48184. diff --git a/pym/portage.py b/pym/portage.py index d264ef68e..ef9e9b5c7 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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