[entropy.spm] fix improperly closed file object

This commit is contained in:
Fabio Erculiani
2010-01-20 07:55:01 +01:00
parent 1af910c289
commit 4da0245f7f
@@ -1489,12 +1489,13 @@ class PortagePlugin(SpmPlugin):
rc = 0
for filename in paths:
proc = subprocess.Popen(qfile_args + (filename,),
stdout = subprocess.PIPE)
rc = proc.wait()
proc.stdout.close()
if rc != 0:
# wtf?, fallback to old way
proc.stdout.close()
matches.clear()
break
@@ -1504,6 +1505,8 @@ class PortagePlugin(SpmPlugin):
obj = matches.setdefault((pkg, slot,), set())
obj.add(filename)
proc.stdout.close()
if rc == 0:
return matches