[yum-commits] Branch 'yum-3_2_X' - yum/__init__.py

James Antill james at osuosl.org
Mon Mar 9 16:14:05 UTC 2009


 yum/__init__.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5371a64275d4d38b85b805568d4dc8815ede1f34
Author: James Antill <james at and.org>
Date:   Mon Mar 9 12:13:59 2009 -0400

    We don't want to create .conf inside __del__ as bad things happen

diff --git a/yum/__init__.py b/yum/__init__.py
index 54a0214..a7ea490 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1129,7 +1129,10 @@ class YumBase(depsolve.Depsolve):
         """do the unlock for yum"""
         
         # if we're not root then we don't lock - just return nicely
-        if self.conf.uid != 0:
+        #  Note that we can get here from __del__, so if we haven't created
+        # YumBase.conf we don't want to do so here as creating stuff inside
+        # __del__ is bad.
+        if hasattr(self, 'preconf') or self.conf.uid != 0:
             return
         
         if lockfile is not None:


More information about the Yum-commits mailing list