From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RGeAD-0006dA-Gi for garchives@archives.gentoo.org; Wed, 19 Oct 2011 21:59:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 33F0121C0F3; Wed, 19 Oct 2011 21:58:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B21DE21C0D7 for ; Wed, 19 Oct 2011 21:58:42 +0000 (UTC) Received: from [192.168.26.4] (ip98-164-193-252.oc.oc.cox.net [98.164.193.252]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 2F2411B4006 for ; Wed, 19 Oct 2011 21:58:42 +0000 (UTC) Message-ID: <4E9F480F.5070909@gentoo.org> Date: Wed, 19 Oct 2011 14:58:39 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 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 2 of 3] repoman: get ChangeLog header from skel.ChangeLog References: <7159f5c3632b51ac9372.1319054145@nut.cheops.ods.org> In-Reply-To: <7159f5c3632b51ac9372.1319054145@nut.cheops.ods.org> X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: X-Archives-Hash: 774d57d91ffdc67b345ac8827262d3c6 On 10/19/2011 12:55 PM, Fabian Groffen wrote: > + if clold_lines[-1].strip(): > + f.write(clold_lines[-1]) If the old ChangeLog happens to be an empty file, then clold_lines[-1] will raise IndexError. So, this is safer: if clold_lines and clold_lines[-1].strip(): -- Thanks, Zac