Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/vcs/git/
Date: Wed, 08 Feb 2017 18:16:46
Message-Id: 1486576337.4375ccd4188467dbd15308baf23331668afe4691.zmedico@gentoo
1 commit: 4375ccd4188467dbd15308baf23331668afe4691
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 8 17:12:26 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 8 17:52:17 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4375ccd4
7
8 Status.check: fix ResourceWarning subprocess "still running" (bug 608594)
9
10 Use repoman_popen context manager, in order to fix Python 3.6
11 ResourceWarnings which report that the subprocess is still running.
12
13 X-Gentoo-Bug: 608594
14 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=608594
15
16 repoman/pym/repoman/modules/vcs/git/status.py | 15 +++++++--------
17 1 file changed, 7 insertions(+), 8 deletions(-)
18
19 diff --git a/repoman/pym/repoman/modules/vcs/git/status.py b/repoman/pym/repoman/modules/vcs/git/status.py
20 index 04f50ceb9..e5aa9c741 100644
21 --- a/repoman/pym/repoman/modules/vcs/git/status.py
22 +++ b/repoman/pym/repoman/modules/vcs/git/status.py
23 @@ -29,15 +29,14 @@ class Status(object):
24 @param xpkg: string of the package being checked
25 @returns: boolean
26 '''
27 - myf = repoman_popen(
28 + with repoman_popen(
29 "git ls-files --others %s" %
30 - (portage._shell_quote(checkdir_relative),))
31 - for l in myf:
32 - if l[:-1][-7:] == ".ebuild":
33 - self.qatracker.add_error(
34 - "ebuild.notadded",
35 - os.path.join(xpkg, os.path.basename(l[:-1])))
36 - myf.close()
37 + (portage._shell_quote(checkdir_relative),)) as myf:
38 + for l in myf:
39 + if l[:-1][-7:] == ".ebuild":
40 + self.qatracker.add_error(
41 + "ebuild.notadded",
42 + os.path.join(xpkg, os.path.basename(l[:-1])))
43 return True
44
45 @staticmethod