From: Ian Cordasco Date: Sun, 25 Nov 2012 03:43:52 +0000 (-0500) Subject: Fix python 3 tests. X-Git-Tag: v1.0.0~104^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b93fbd30c32b122bf7aba7db6663ca5a292b17d3;p=services%2Fpython-requests.git Fix python 3 tests. --- diff --git a/requests/models.py b/requests/models.py index 4025dae..44b41d8 100644 --- a/requests/models.py +++ b/requests/models.py @@ -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)