MergeProcess: check if _elog_reader_fd is None
authorZac Medico <zmedico@gentoo.org>
Thu, 1 Dec 2011 20:34:52 +0000 (12:34 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 1 Dec 2011 20:34:52 +0000 (12:34 -0800)
It seems saner to check for None, given that _elog_reader_fd is an int,
even though it will probably never be zero.

pym/portage/dbapi/_MergeProcess.py

index c9b628865895ebe458c2218dc884c2fa540758dd..df501be385de988c0baac2eac8d7750ac107f535 100644 (file)
@@ -212,7 +212,7 @@ class MergeProcess(SpawnProcess):
                if self._elog_reg_id is not None:
                        self.scheduler.unregister(self._elog_reg_id)
                        self._elog_reg_id = None
-               if self._elog_reader_fd:
+               if self._elog_reader_fd is not None:
                        os.close(self._elog_reader_fd)
                        self._elog_reader_fd = None
                if self._elog_keys is not None: