_emerge/SubProcess.py: support int fd in _files
authorZac Medico <zmedico@gentoo.org>
Thu, 1 Dec 2011 21:05:24 +0000 (13:05 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 1 Dec 2011 21:05:24 +0000 (13:05 -0800)
pym/_emerge/SubProcess.py

index b99cf0bb11493598ae7ee4a28649ea0939619775..37922dc666bf0e766ba94fcff58a028d42dbcdba 100644 (file)
@@ -120,7 +120,10 @@ class SubProcess(AbstractPollTask):
 
                if self._files is not None:
                        for f in self._files.values():
-                               f.close()
+                               if isinstance(f, int):
+                                       os.close(f)
+                               else:
+                                       f.close()
                        self._files = None
 
        def _set_returncode(self, wait_retval):