From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 82FE61387FD for ; Fri, 28 Mar 2014 09:07:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 06F68E0AC6; Fri, 28 Mar 2014 09:07:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 51DB2E0AC4 for ; Fri, 28 Mar 2014 09:07:51 +0000 (UTC) Received: from [192.168.0.3] (107.4.189.109.customer.cdi.no [109.189.4.107]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: bernalex) by smtp.gentoo.org (Postfix) with ESMTPSA id 081A233FDA1 for ; Fri, 28 Mar 2014 09:07:49 +0000 (UTC) Message-ID: <53353BE5.4080804@gentoo.org> Date: Fri, 28 Mar 2014 10:07:49 +0100 From: Alexander Berntsen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] depgraph: Skip atoms that are None (bug 505944) References: <1395922863-7944-1-git-send-email-bernalex@gentoo.org> <20140327091608.46339c1d.dolsen@gentoo.org> In-Reply-To: <20140327091608.46339c1d.dolsen@gentoo.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 99c387ba-9e0c-470d-86d9-9efcb564d229 X-Archives-Hash: 40dc5b48cf4b16c78675599c4d99ee17 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 27/03/14 17:16, Brian Dolbec wrote: > diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py > index 83035c2..61ef31d 100644 --- a/pym/_emerge/depgraph.py +++ > b/pym/_emerge/depgraph.py @@ -1942,8 +1942,9 @@ class > depgraph(object): # Display the specific atom from SetArg or # > Package types. uneval = "" - if > dep.atom is not dep.atom.unevaluated_atom: - > uneval = " (%s)" % (dep.atom.unevaluated_atom,) + > if dep.atom and dep.atom.unevaluated_atom: + > if dep.atom is not dep.atom.unevaluated_atom: + > uneval = " (%s)" % (dep.atom.unevaluated_atom,) writemsg_level( > "%s%s%s required by %s\n" % ("Parent Dep:".ljust(15), dep.atom, > uneval, myparent), lines 1-16/16 (END) > > > This takes advantage of the fact that uneval is initialized to "" > Then only reassigns it if there is actually a mismatch. Sure. I'd use one "if" instead of two. - -- Alexander bernalex@gentoo.org https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlM1O+UACgkQRtClrXBQc7XL+AD/Wn5sbE/O3QFAl7nBYblVWFAK LBVwmY3XEOT2blgIPfIA/2a8IspgldZxO2AmLQ/bZNnFcigUPejaZ1V8J97JJuiu =qc0Y -----END PGP SIGNATURE-----