commit: 4375ccd4188467dbd15308baf23331668afe4691 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Wed Feb 8 17:12:26 2017 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Wed Feb 8 17:52:17 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4375ccd4
Status.check: fix ResourceWarning subprocess "still running" (bug 608594) Use repoman_popen context manager, in order to fix Python 3.6 ResourceWarnings which report that the subprocess is still running. X-Gentoo-Bug: 608594 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=608594 repoman/pym/repoman/modules/vcs/git/status.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/repoman/pym/repoman/modules/vcs/git/status.py b/repoman/pym/repoman/modules/vcs/git/status.py index 04f50ceb9..e5aa9c741 100644 --- a/repoman/pym/repoman/modules/vcs/git/status.py +++ b/repoman/pym/repoman/modules/vcs/git/status.py @@ -29,15 +29,14 @@ class Status(object): @param xpkg: string of the package being checked @returns: boolean ''' - myf = repoman_popen( + with repoman_popen( "git ls-files --others %s" % - (portage._shell_quote(checkdir_relative),)) - for l in myf: - if l[:-1][-7:] == ".ebuild": - self.qatracker.add_error( - "ebuild.notadded", - os.path.join(xpkg, os.path.basename(l[:-1]))) - myf.close() + (portage._shell_quote(checkdir_relative),)) as myf: + for l in myf: + if l[:-1][-7:] == ".ebuild": + self.qatracker.add_error( + "ebuild.notadded", + os.path.join(xpkg, os.path.basename(l[:-1]))) return True @staticmethod
