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
8c900db5
Commit
8c900db5
authored
Oct 16, 2010
by
Josh Roesslein
Browse files
Fix a bug in the cache code which would error when loading non-Model objects.
parent
68c74580
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/binder.py
View file @
8c900db5
...
...
@@ -9,6 +9,7 @@ import re
from
tweepy.error
import
TweepError
from
tweepy.utils
import
convert_to_utf8_str
from
tweepy.models
import
Model
re_path_template
=
re
.
compile
(
'{\w+}'
)
...
...
@@ -114,9 +115,11 @@ def bind_api(**config):
# must restore api reference
if
isinstance
(
cache_result
,
list
):
for
result
in
cache_result
:
result
.
_api
=
self
.
api
if
isinstance
(
result
,
Model
):
result
.
_api
=
self
.
api
else
:
cache_result
.
_api
=
self
.
api
if
isinstance
(
cache_result
,
Model
):
cache_result
.
_api
=
self
.
api
return
cache_result
# Continue attempting request until successful
...
...
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