Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
86f0712b
Commit
86f0712b
authored
Apr 26, 2014
by
Joshua Roesslein
Browse files
Fix errors due to Requests merge.
parent
11b15260
Changes
2
Hide whitespace changes
Inline
Side-by-side
tweepy/auth.py
View file @
86f0712b
#Embedded file name: /home/aaron/repos/tweepy/tweepy/auth.py
from
urllib2
import
Request
,
urlopen
import
urllib
import
base64
import
json
from
tweepy
import
oauth
from
tweepy.error
import
TweepError
from
tweepy.api
import
API
import
requests
...
...
tweepy/binder.py
View file @
86f0712b
...
...
@@ -162,12 +162,12 @@ def bind_api(**config):
auth
=
auth
)
except
Exception
,
e
:
raise
TweepError
(
'Failed to send request: %s'
%
e
)
rem_calls
=
resp
.
get
header
(
'x-rate-limit-remaining'
)
rem_calls
=
resp
.
header
s
.
get
(
'x-rate-limit-remaining'
)
if
rem_calls
is
not
None
:
self
.
_remaining_calls
=
int
(
rem_calls
)
elif
isinstance
(
self
.
_remaining_calls
,
int
):
self
.
_remaining_calls
-=
1
reset_time
=
resp
.
get
header
(
'x-rate-limit-reset'
)
reset_time
=
resp
.
header
s
.
get
(
'x-rate-limit-reset'
)
if
reset_time
is
not
None
:
self
.
_reset_time
=
int
(
reset_time
)
if
self
.
wait_on_rate_limit
and
self
.
_remaining_calls
==
0
and
(
resp
.
status
==
429
or
resp
.
status
==
420
):
# if ran out of calls before waiting switching retry last call
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment