From 35798ff1b1b6b5c0de4141b5440b0fe0bd750da8 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 20 Mar 2013 11:13:53 -0700 Subject: [PATCH] resolver: output: check for None mainRepo() mainRepo() can return none when we are on a machine that is only using PORTAGE_BINHOST and not a normal PORTAGE. Make sure we don't crash here. --- pym/_emerge/resolver/output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 46a13bf6a..a14478ee1 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -385,7 +385,7 @@ class Display(object): if old_pkg.slot != old_pkg.sub_slot or \ old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot: key += "/" + old_pkg.sub_slot - if not self.quiet_repo_display and (self.verbose_main_repo_display or + if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])): key += _repo_separator + old_pkg.repo versions.append(key) @@ -419,7 +419,7 @@ class Display(object): @param pkg_info: dictionary @rtype string """ - if not self.quiet_repo_display and (self.verbose_main_repo_display or + if not self.quiet_repo_display and self.portdb.repositories.mainRepo() and (self.verbose_main_repo_display or any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])): pkg_str += _repo_separator + pkg.repo return pkg_str -- 2.26.2