daler/pybedtools — comment on commit 9283bf86bbebcc77fc341ea82a1c21f91b07e44d
File:  line 0
By brentp:

I was sorta suprised it worked. It's closing the Popen() stream. So you may be able to do:

```python
if hasattr(output, "communicate"):
output.close()
```
in the finally block