Or we could do it with duck-typing...

```python
if hasattr(obj, 'fp'):
    # Object is a container for another file-like object which gets released on exhaustion (such as HTTPResponse).
    return obj.fp is None

return obj.closed
```

(Makes a little more sense to rename the `fp` param to `obj` in this case.)