diff options
author | Zac Medico <zmedico@gentoo.org> | 2017-02-08 09:12:26 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2017-02-08 09:52:17 -0800 |
commit | 4375ccd4188467dbd15308baf23331668afe4691 (patch) | |
tree | a893b26f2c731317f48e1fd350b66566c69a8698 /repoman/pym/repoman/modules/vcs | |
parent | PopenProcess: suppress ResourceWarning subprocess "still running" (bug 608594) (diff) | |
download | portage-4375ccd4188467dbd15308baf23331668afe4691.tar.gz portage-4375ccd4188467dbd15308baf23331668afe4691.tar.bz2 portage-4375ccd4188467dbd15308baf23331668afe4691.zip |
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
Diffstat (limited to 'repoman/pym/repoman/modules/vcs')
-rw-r--r-- | repoman/pym/repoman/modules/vcs/git/status.py | 15 |
1 files 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 |