summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRoman Haritonov <reclosedev@gmail.com>2016-03-29 22:43:57 +0400
committerRoman Haritonov <reclosedev@gmail.com>2016-03-29 22:43:57 +0400
commit2d2d017e429161e2b16af5272a2a96a600d71955 (patch)
tree846d419d93e595aec7d58f2f098d8bee1130144b /docs
parentb708644060ef22405ebc6b752c1fcb12a6bc1335 (diff)
downloadrequests-cache-2d2d017e429161e2b16af5272a2a96a600d71955.tar.gz
fix #62 - Update throttle_hook example
Diffstat (limited to 'docs')
-rw-r--r--docs/user_guide.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/user_guide.rst b/docs/user_guide.rst
index 56b148e..811be40 100644
--- a/docs/user_guide.rst
+++ b/docs/user_guide.rst
@@ -100,9 +100,9 @@ It can be used, for example, for request throttling with help of ``requests`` ho
Returns a response hook function which sleeps for `timeout` seconds if
response is not cached
"""
- def hook(response):
+ def hook(response, *args, **kwargs):
if not getattr(response, 'from_cache', False):
- print 'sleeping'
+ print('sleeping')
time.sleep(timeout)
return response
return hook