]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/api.py
Fix issue #43 TwitterHTTPError.__str__ messed up.
[z_archive/twitter.git] / twitter / api.py
index 6cfc650498e8f0179ff3f1726a359d6497a0c17c..2c0279013fc1987cbd75bc041de8282e0e025c8b 100644 (file)
@@ -33,13 +33,14 @@ class TwitterHTTPError(TwitterError):
         self.uri = uri
         self.format = format
         self.uriparts = uriparts
+        self.response_data = self.e.fp.read()
 
     def __str__(self):
         return (
             "Twitter sent status %i for URL: %s.%s using parameters: "
             "(%s)\ndetails: %s" %(
                 self.e.code, self.uri, self.format, self.uriparts,
-                self.e.fp.read()))
+                self.response_data))
 
 class TwitterResponse(object):
     """
@@ -78,11 +79,6 @@ def wrap_response(response, headers):
     class WrappedTwitterResponse(response_typ, TwitterResponse):
         __doc__ = TwitterResponse.__doc__
 
-        def __init__(self, response):
-            if response_typ is not int:
-                response_typ.__init__(self, response)
-            TwitterResponse.__init__(self, headers)
-
     return WrappedTwitterResponse(response)