Gentoo Archives: gentoo-portage-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-portage-dev@l.g.o
Cc: SebastianLuther@×××.de
Subject: Re: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed
Date: Mon, 06 Jan 2014 21:38:04
Message-Id: 201401061638.04053.vapier@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed by SebastianLuther@gmx.de
1 On Monday 06 January 2014 16:04:16 SebastianLuther@×××.de wrote:
2 > + f = open(layout_conf_path, "w")
3 > + f.write("masters = test_repo\n")
4 > + f.close()
5
6 please use "with" in your code
7 with open(layout_conf_path, 'w') as f:
8 f.write('masters = test_repo\n')
9 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed Sebastian Luther <SebastianLuther@×××.de>