diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:33 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:33 -0700 |
commit | d075cc8a1294c77c994dc5fd220ecb163ed31b93 (patch) | |
tree | d0f8ca4e6a5c55a074f348713048c560bb852d72 /requests/packages/urllib3/util/response.py | |
parent | ca5cb993a3ce4fbdf50eebd31cb6b71eec9bc391 (diff) | |
download | python-requests-d075cc8a1294c77c994dc5fd220ecb163ed31b93.tar python-requests-d075cc8a1294c77c994dc5fd220ecb163ed31b93.tar.gz |
Imported Upstream version 2.3.0
Diffstat (limited to 'requests/packages/urllib3/util/response.py')
-rw-r--r-- | requests/packages/urllib3/util/response.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/requests/packages/urllib3/util/response.py b/requests/packages/urllib3/util/response.py new file mode 100644 index 0000000..d0325bc --- /dev/null +++ b/requests/packages/urllib3/util/response.py @@ -0,0 +1,13 @@ +def is_fp_closed(obj): + """ + Checks whether a given file-like object is closed. + + :param obj: + The file-like object to check. + """ + if hasattr(obj, 'fp'): + # Object is a container for another file-like object that gets released + # on exhaustion (e.g. HTTPResponse) + return obj.fp is None + + return obj.closed |