RepoConfigLoader: handle main_repo in __delitem__
authorZac Medico <zmedico@gentoo.org>
Thu, 8 Aug 2013 16:04:36 +0000 (09:04 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 8 Aug 2013 16:04:36 +0000 (09:04 -0700)
This will fix bug #480254.

pym/portage/repository/config.py

index 5c37da3319dfd6ba0e96e4e3477f88654add7f01..7b49eea7a61890e64ca7f81526440489d9e01f77 100644 (file)
@@ -886,6 +886,8 @@ class RepoConfigLoader(object):
                return self.prepos[repo_name]
 
        def __delitem__(self, repo_name):
+               if repo_name == self.prepos['DEFAULT'].main_repo:
+                       self.prepos['DEFAULT'].main_repo = None
                location = self.prepos[repo_name].location
                del self.prepos[repo_name]
                if repo_name in self.prepos_order: