]> jfr.im git - z_archive/twitter.git/commitdiff
Move the potentially uninitialized values out of the if test.
authorAndrew W. Donoho <redacted>
Thu, 16 Jan 2014 21:10:54 +0000 (15:10 -0600)
committerAndrew W. Donoho <redacted>
Thu, 16 Jan 2014 21:10:54 +0000 (15:10 -0600)
twitter/api.py

index ed6b99ec55c032980d8468acbeeb7b4ebbce13c4..0e4377d930b01d2a2a0c9bc82c4f8aa8731a0c49 100644 (file)
@@ -196,12 +196,12 @@ class TwitterCall(object):
                     secure_str, self.domain, uri, dot, self.format)
 
         headers = {'Accept-Encoding': 'gzip'} if self.gzip else dict()
                     secure_str, self.domain, uri, dot, self.format)
 
         headers = {'Accept-Encoding': 'gzip'} if self.gzip else dict()
+        body = None; arg_data = None
         if self.auth:
             headers.update(self.auth.generate_headers())
             arg_data = self.auth.encode_params(uriBase, method, kwargs)
             if method == 'GET':
                 uriBase += '?' + arg_data
         if self.auth:
             headers.update(self.auth.generate_headers())
             arg_data = self.auth.encode_params(uriBase, method, kwargs)
             if method == 'GET':
                 uriBase += '?' + arg_data
-                body = None
             else:
                 body = arg_data.encode('utf8')
 
             else:
                 body = arg_data.encode('utf8')