diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-08-25 16:45:32 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-08-25 16:45:32 -0700 |
commit | 0484dccadf2021fd288daccea881ee1d352b0f7d (patch) | |
tree | 9ff21c114edc55f8c982cc05fc013f5056b3f99e | |
parent | 3c954b62643a3c645d7172b47b0582599606cc29 (diff) | |
download | portage-0484dccadf2021fd288daccea881ee1d352b0f7d.tar.gz portage-0484dccadf2021fd288daccea881ee1d352b0f7d.tar.bz2 portage-0484dccadf2021fd288daccea881ee1d352b0f7d.zip |
python3.2 fixes: ResourceWarning: unclosed file
-rwxr-xr-x | bin/dispatch-conf | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 1e21a521b..497927df4 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -O -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @@ -100,7 +100,9 @@ class dispatch: path, basename = os.path.split(path) find_opts = "-maxdepth 1" - confs += self.massage(os.popen(FIND_EXTANT_CONFIGS % (path, find_opts, basename)).readlines()) + with os.popen(FIND_EXTANT_CONFIGS % + (path, find_opts, basename)) as proc: + confs += self.massage(proc.readlines()) if self.options['use-rcs'] == 'yes': for rcs_util in ("rcs", "ci", "co", "rcsmerge"): |