Avoid useless and ugly atexit tracebacks that are triggered when
authorZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 22:03:49 +0000 (22:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 22:03:49 +0000 (22:03 -0000)
portage exits during the portdbapi constructor. (trunk r6620)

svn path=/main/branches/2.1.2/; revision=7863

pym/portage.py

index 14d3e60d0cd548a8e82033bc947ceba8d559a9f9..c3c640182ecb0cd4572656fc12a1fe819194e7d2 100644 (file)
@@ -6113,6 +6113,9 @@ class portdbapi(dbapi):
                        pass
 
        def close_caches(self):
+               if not hasattr(self, "auxdb"):
+                       # unhandled exception thrown from constructor
+                       return
                for x in self.auxdb:
                        self.auxdb[x].sync()
                self.auxdb.clear()