]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/api.py
Use base64 library instead of .encode("base64")
[z_archive/twitter.git] / twitter / api.py
index 694d2c4d679ad7e4724ba4f0aaf3f504488243b7..6927f51b81302b9da14a1e9edff73f9b3514adbd 100644 (file)
@@ -1,7 +1,5 @@
 import urllib2
 
 import urllib2
 
-from exceptions import Exception
-
 from twitter.twitter_globals import POST_ACTIONS
 from twitter.auth import NoAuth
 
 from twitter.twitter_globals import POST_ACTIONS
 from twitter.auth import NoAuth
 
@@ -72,14 +70,16 @@ def wrap_response(response, headers):
     if response_typ is bool:
         # HURF DURF MY NAME IS PYTHON AND I CAN'T SUBCLASS bool.
         response_typ = int
     if response_typ is bool:
         # HURF DURF MY NAME IS PYTHON AND I CAN'T SUBCLASS bool.
         response_typ = int
-    class WrappedTwitterResponse(TwitterResponse, response_typ):
+
+    class WrappedTwitterResponse(response_typ, TwitterResponse):
         __doc__ = TwitterResponse.__doc__
 
         __doc__ = TwitterResponse.__doc__
 
-        def __init__(self, response, headers):
-            response_typ.__init__(self, response)
+        def __init__(self, response):
+            if response_typ is not int:
+                response_typ.__init__(self, response)
             TwitterResponse.__init__(self, headers)
 
             TwitterResponse.__init__(self, headers)
 
-    return WrappedTwitterResponse(response, headers)
+    return WrappedTwitterResponse(response)