Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 35D96431FD2 for ; Sat, 5 Apr 2014 10:31:38 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l2AZvDVQt2YO for ; Sat, 5 Apr 2014 10:31:32 -0700 (PDT) Received: from qmta09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [76.96.62.96]) by olra.theworths.org (Postfix) with ESMTP id 66B17431FB6 for ; Sat, 5 Apr 2014 10:31:26 -0700 (PDT) Received: from omta13.westchester.pa.mail.comcast.net ([76.96.62.52]) by qmta09.westchester.pa.mail.comcast.net with comcast id mFjN1n00517dt5G59HXR9K; Sat, 05 Apr 2014 17:31:25 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta13.westchester.pa.mail.comcast.net with comcast id mHXQ1n00o152l3L3ZHXRQb; Sat, 05 Apr 2014 17:31:25 +0000 Received: from mjolnir.tremily.us (unknown [192.168.0.140]) by odin.tremily.us (Postfix) with ESMTPS id AFEE91103C14; Sat, 5 Apr 2014 10:31:24 -0700 (PDT) Received: (nullmailer pid 16915 invoked by uid 1000); Sat, 05 Apr 2014 17:31:15 -0000 From: "W. Trevor King" To: notmuch@notmuchmail.org Subject: [PATCH 2/7] doc/mkdocdeps.py: Use "with" statement for the output file Date: Sat, 5 Apr 2014 10:31:06 -0700 Message-Id: <543aee63407956e60f85dc11a2d25855e98c10c3.1396718720.git.wking@tremily.us> X-Mailer: git-send-email 1.9.1.353.gc66d89d In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1396719085; bh=EUaDylg69IHiWfHMYQnINVTyWhPaW7ppXPGfzYThfBo=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=bQ/ph/jzoJ9yErrGs2y7J9RWFjWbJsPf7/gQxVFjRXYBds2oVj3GlRbNYYNldQa7j JfnTp1FB6MHtHQHzKRWg28KsNk2hORs3/m/7qQf2Y4b18UXWuzCFv990W/BBcJ5e2p E1g2ZzvXvABUBPa9shUpIJQ9VkG/tSpzaGV67GzbqOiks2kZ9CyROyNY77Oksikpb/ oLMqw1PKPP5FJioYpOYvyHBA9umOpIAjcIkt0tcdPi3nYUFcbU9JM8fIj94ktpTGFc hvzvuU4QlmyRgObhSED91QAxlc5Aw31KbCckh6xrzUG9cb+08iJeYWhtaQhMof6zaj VJBT8K2AhksxA== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:31:38 -0000 Before this patch, the open was unnecessarily early and relied on the process cleanup to close. Neither one of these was a real problem, but PEP 343's context managers (which landed in Python 2.5) make proper cleanup very easy. [1]: http://legacy.python.org/dev/peps/pep-0343/ --- doc/mkdocdeps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/mkdocdeps.py b/doc/mkdocdeps.py index de1cbb8..b87fe3e 100644 --- a/doc/mkdocdeps.py +++ b/doc/mkdocdeps.py @@ -9,10 +9,10 @@ import conf roff_files = [] rst_files = [] -out=open(outfile,'w') for page in conf.man_pages: rst_files = rst_files + ["{0:s}/{1:s}.rst".format(srcdir,page[0])] roff_files = roff_files + ["{0:s}/man/{1:s}.{2:d}".format(builddir,page[0],page[4])] -out.write ('MAN_ROFF_FILES := ' + ' \\\n\t'.join(roff_files)+'\n') -out.write ('MAN_RST_FILES := ' + ' \\\n\t'.join(rst_files)+'\n') +with open(outfile, 'w') as out: + out.write('MAN_ROFF_FILES := ' + ' \\\n\t'.join(roff_files) + '\n') + out.write('MAN_RST_FILES := ' + ' \\\n\t'.join(rst_files) + '\n') -- 1.9.1.353.gc66d89d