projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13b8d0d
)
Close Requests sessions
author
Harmon
<Harmon758@gmail.com>
Tue, 9 Jul 2019 19:50:34 +0000
(14:50 -0500)
committer
Harmon
<Harmon758@gmail.com>
Tue, 9 Jul 2019 19:50:34 +0000
(14:50 -0500)
Fixes #810
Fixes #1093
Resolves #1237
tweepy/binder.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/binder.py
b/tweepy/binder.py
index 414bfd95a1bb97563e8fcfcaf6ce7246a20e31c0..487482aa167db5a980829b03bc96ad64ef825b78 100644
(file)
--- a/
tweepy/binder.py
+++ b/
tweepy/binder.py
@@
-241,10
+241,13
@@
def bind_api(**config):
def _call(*args, **kwargs):
method = APIMethod(args, kwargs)
- if kwargs.get('create'):
- return method
- else:
- return method.execute()
+ try:
+ if kwargs.get('create'):
+ return method
+ else:
+ return method.execute()
+ finally:
+ method.session.close()
# Set pagination mode
if 'cursor' in APIMethod.allowed_param: