(self, timeout=None)
| 180 | ) |
| 181 | |
| 182 | def close(self, timeout=None): |
| 183 | with self._lock: |
| 184 | if not hasattr(self, '_process'): |
| 185 | return |
| 186 | try: |
| 187 | self._communicator.close(timeout) |
| 188 | finally: |
| 189 | if self._process.poll() is None: |
| 190 | self._process.kill() |
| 191 | del self._process |
| 192 | del self._communicator |
| 193 | |
| 194 | # I use the part above as a generic utility module. A simple echo example follows: |
| 195 |