Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH 2 of 3] repoman: get ChangeLog header from skel.ChangeLog
Date: Wed, 19 Oct 2011 21:59:05
Message-Id: 4E9F480F.5070909@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 2 of 3] repoman: get ChangeLog header from skel.ChangeLog by Fabian Groffen
1 On 10/19/2011 12:55 PM, Fabian Groffen wrote:
2 > + if clold_lines[-1].strip():
3 > + f.write(clold_lines[-1])
4
5 If the old ChangeLog happens to be an empty file, then clold_lines[-1]
6 will raise IndexError. So, this is safer:
7
8 if clold_lines and clold_lines[-1].strip():
9
10 --
11 Thanks,
12 Zac

Replies