Fix python 3 tests.

This commit is contained in:
Ian Cordasco
2012-11-24 22:43:52 -05:00
parent 61f16d1ddc
commit b93fbd30c3
+1 -1
View File
@@ -542,7 +542,7 @@ class Request(object):
content_type = 'application/x-www-form-urlencoded'
self.headers['Content-Length'] = '0'
if isinstance(body, file):
if hasattr(body, 'seek') and hasattr(body, 'tell'):
body.seek(0, 2)
self.headers['Content-Length'] = str(body.tell())
body.seek(0, 0)